General information
Forum:
Microsoft SQL Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only