| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
|
Another approach is to list all the duplicate entries. We assume the field 'id' is the primary key of the table 'users'
SELECT DISTINCT t1.id, t1.email FROM users t1, users t2 WHERE t1.email = t2.email AND t1.id <> t2.id |
|
|||
|
Quote:
ERROR: column "users.id" must appear in the GROUP BY clause or be used in an aggregate function |
|
|||
|
Yes, the statement is not valid according to SQL standards. It a documented behaviour of MySQL.
|
![]() |
| Thread Tools | Search this Thread |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.sqlrecipes.com/sql_questions_answers/find_duplicate_entries_table-5/
|
|||
| Posted By | For | Type | Date |
| PHP script resource - [MSSQL] leidige theme Dubletten | This thread | Refback | 03-06-2008 01:29 PM |
| Discover From Your Favorite Topic or Web Page: www.w3schools.com/sql/sql_join.asp | This thread | Refback | 02-29-2008 05:31 AM |
| PHP script resource [MSSQL] leidige theme Dubletten | This thread | Refback | 08-19-2007 09:51 PM |
| PHP script resource - [MSSQL] leidige theme Dubletten | This thread | Refback | 07-11-2007 10:45 AM |
| PHP script resource - [MSSQL] leidige theme Dubletten | This thread | Refback | 05-31-2007 02:25 PM |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Selecting Duplicate Entries in a table? | Simon | SQL - Questions and Answers | 6 | 06-09-2008 11:15 PM |