Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Do A Cross Tab
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01520803
Message ID:
01520898
Vues:
40
>Each county has multiple occurances of precincts. The final result should be a table with one column for each county. In each column should be only one occurance of each precinct in tht county.
>
>So, for Adams, assume it had:
>
>
>ADAMS
>=======
>PRE 1
>PRE 1
>PRE 1
>PRE 2
>PRE 2
>PRE 3
>PRE 3
>PRE 3
>PRE 4
>
>
>the result should be
>
>ADAMS
>=======
>PRE 1
>PRE 2
>PRE 3
>PRE 4
>
If they are trully duplicates, then the code I gave you in the very first message should have eliminated them. If you're seeing them, it means they are not true duplicates.

To find out, try
select MailCounty, Precinct, count(*) as cntDups
from myTable
where MailCounty = 'ADAMS'
GROUP BY MailCounty, Precinct
HAVING COUNT(*) > 1
Do you see your duplicates here?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform