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 |
|
vmurali
Yak Posting Veteran
88 Posts |
Posted - 2007-03-05 : 01:31:34
|
| Hi,I need one query which fetches the list of all the employess having same salary. Table structure:Employee (emp_name, emp_id, dept, sal)Now, I want the list of all the employess who have same salary. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-05 : 01:33:45
|
| select e.* from employee as einner join (SELECT sal from employee group by sal having count(*) > 1) as x on x.sal = e.salorder by e.sal desc, e.emp_idPeter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-05 : 01:35:49
|
| Or the basicselect * from employee where sal = @WantedSalaryPeter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|