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 - 2004-11-08 : 08:18:27
|
| Rajib Mandal writes "I am facing some typical problem.I have a table EmpEmpId Salary1 10002 20003 30004 40005 50006 6000I want a output that returns a result for each empId the no of persons who earns more salary meansEmpId No persons1 52 43 3" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-11-08 : 08:29:03
|
| select empid, (select count(*) from emp t2 where t2.salary > t1.salary)from emp t1==========================================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. |
 |
|
|
|
|
|