Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 MS SQL QUERY

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-06 : 11:40:57
Someswar Sinha Roy writes "1.How to fetch last 5 records.?
2.How to view duplicate records.?
3.I have a table with empid and mgrid,i want to select empid having only mgrid?
4.How to use trnsaction log effectively."

mr_mist
Grunnio

1870 Posts

Posted - 2004-07-06 : 11:51:04
1. There's no concept of "last" in a record set, unless you have a date field. TOP 5 ... ORDER BY that date in whatever way you want.

2. SELECT count(*), colnames... FROM table group by colnames having count(*) > 1

3. SELECT empid from table where mgrid is not null

4. To do what?

-------
Moo. :)
Go to Top of Page
   

- Advertisement -