Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query help

Status
Not open for further replies.

micjohnson

Programmer
Nov 9, 2000
86
US
How to I write query to get duplicate column count.

For eg,

One user has 5 accounts on a website with 5 different user logins(primary key), same email address and same password on 5 account.

How do I find that how many users has more than one accounts with same email and same password?

Thanks in advance.
 
Code:
SELECT eMail, [Password]
FROM YourTable
GROUP BY eMail, [Password]
HAVING COUNT(*) > 1

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top