Information générale
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,
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement