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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-07-21 : 09:45:08
|
| Paromita writes "Can anyone please tell me how can I rewrite the query using Not exists : select distinct top 1 employeeid from #testwhere employeeid not in(select max(employeeid) from #test)group by employeeidorder by employeeid desc" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-07-21 : 10:13:06
|
| Doesn't use not exists butselect top 1 employeeid from (select top 2 employeeid from #test group by employeeid order by employeeid desc) aorder by employeeid==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|