Checking the uniqueness of data
From: Griff (Howling_at_The.Moon)
Date: 10/22/04
- Next message: Adam Machanic: "Re: Cross Tab"
- Previous message: Krygim: "Which will take up more space?"
- Next in thread: Adam Machanic: "Re: Checking the uniqueness of data"
- Reply: Adam Machanic: "Re: Checking the uniqueness of data"
- Reply: Stringfellow Hawke: "Re: Checking the uniqueness of data"
- Reply: Aaron [SQL Server MVP]: "Re: Checking the uniqueness of data"
- Reply: Alejandro Mesa: "RE: Checking the uniqueness of data"
- Reply: Tom Moreau: "Re: Checking the uniqueness of data"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 22 Oct 2004 14:12:01 +0100
I have a very large table containing user details.
There are two columns of interest, "userName" and "accountName".
I wish to use SQL to interrogate this table to find out how many non-unique
userNames there are for each accountName.
I.e., if accountName = "Development" and all the userNames are unique, then
I'd want to retrieve the value 0. If the accountName is "Marketing" and
there are 12 Sharons, 15 Paulas and 8 Robins, but all the rest were unique,
I'd want the value 3 (i.e. three names that were not unique).
However, I've no idea how to achieve this in SQL. Any clues much
appreciated.
Many thanks in advance
Griff
- Next message: Adam Machanic: "Re: Cross Tab"
- Previous message: Krygim: "Which will take up more space?"
- Next in thread: Adam Machanic: "Re: Checking the uniqueness of data"
- Reply: Adam Machanic: "Re: Checking the uniqueness of data"
- Reply: Stringfellow Hawke: "Re: Checking the uniqueness of data"
- Reply: Aaron [SQL Server MVP]: "Re: Checking the uniqueness of data"
- Reply: Alejandro Mesa: "RE: Checking the uniqueness of data"
- Reply: Tom Moreau: "Re: Checking the uniqueness of data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|