Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query help
Message
From
24/09/2004 15:03:24
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Query help
Miscellaneous
Thread ID:
00945843
Message ID:
00945843
Views:
56
Hello

I need to return all rows that have the same COL2+ COL3.
I am able to get the query to return the correct
rows that are duplicated but when I try to get COL1 to return as part of the list..


SELECT col1,col2,col3
FROM tableA
GROUP BY col2, col3
HAVING COUNT(*) >1
ORDER BY col2,col3

This will generate an error and state that I need to incorporate col1 as an aggregate..when I place a MAX around col1, I receive only 1 of 2 possible values back.



COL1 COL2 COL3
A 1 50
B 1 50
C 2 60
D 2 60
E 3 70
F 5 77


Any ideas?

Thanks,
Next
Reply
Map
View

Click here to load this message in the networking platform