Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Do A Cross Tab
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01520803
Message ID:
01520898
Views:
39
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform