Adsense
Popular Posts
- jQuery autocomplete scroll bar for dropdown menu
- JavaScript Arrays and Associate Arrays
- mod_auth_cas.so error: undefined symbol: SSL_connect
- Design date and signature box in Latex
- Install APXS in Redhat Linux
- JavaScript, remove trailing insignificant zeros after toFixed function
- jQuery, toggle the display
- Difference between state and props in React
- Set Windows path command line
- super(props) in React
Thursday, July 17, 2014
check duplication of a column value in MySQL
To find the duplicate username in users table in MySQL:
SELECT username, COUNT(*) c
FROM `users`
GROUP BY username
HAVING c> 1
To get more detail information
SELECT firstname, lastname, username
FROM `users`
WHERE username IN
(
SELECT username
FROM `users`
GROUP BY username
HAVING COUNT(*) > 1
)
Labels:
MySQL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment