MVIT
Right there with Babe
Points: 748
More actions
October 25, 2011 at 9:27 am
#259249
Table Data
---------------------------
ID Dept-ID Version
10 30 0
20 30 0
20 30 1
20 40 2
30 50 0
30 50 1
30 60 2
40 30 0
40 30 1
-------------
Expected Output
ID
20
30
Ninja's_RGR'us
SSC Guru
Points: 294069
October 25, 2011 at 9:46 am
#1399191
SELECT ID FROM dbo.Table GROUP BY ID HAVING COUNT(*) > 1
October 25, 2011 at 9:52 am
#1399197
I guess this won't return the expected output. It will return even 40 as well which is not the desired output.
October 25, 2011 at 9:56 am
#1399199
SELECT ID FROM dbo.Table
GROUP BY ID
HAVING COUNT(DISTINCT DepartmentId) > 1
October 25, 2011 at 10:23 am
#1399214
THNKS FOR THE rEPLY 🙂
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply