Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Comparing data for column

Author  Topic 

Hym1988
Starting Member

4 Posts

Posted - 2012-03-17 : 10:50:40
Hello

I would like to ask you for help guys.

I have database with about 4000 users, and Iam trying to search for multi account users. A lot of them have that same password for their accounts so I figuerd that will be nice to search column "password" ford same data and than I will investigate if they are realy multi or not. I know I can use "Order By password" but there is 4000 users as I said before so it will be hard and long work.
So I would like to ask you for some help. I would like to get list of accounts who have same passwords , and there would be not shown accounts with unique password.

Here is some part of my db.



Best regards

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-17 : 13:38:17
do you mean this?


SELECT t.*
FROM Table t
INNER JOIN (SELECT password
FROM table
GROUP BY password
HAVING COUNT(*) > 1
)t1
ON t1.password = t.password


but its not a accurate comparison as there's a very little chance of same password for different users

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -