Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query help
Message
De
24/09/2004 15:03:24
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Query help
Divers
Thread ID:
00945843
Message ID:
00945843
Vues:
55
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
Fil
Voir

Click here to load this message in the networking platform