in reply to Select all duplicates from SQLite
Anyway see : https://stackoverflow.com/questions/2594829/finding-duplicate-values-in-a-sql-table.
Your query will have to be something like:
UPDATE: The following schema/query gets the desired result:SELECT y.id,y.name,y.email FROM @YourTable y INNER JOIN (SELECT name,email, COUNT(*) AS CountOf FROM @YourTable GROUP BY name,email HAVING COUNT(*)>1 ) dt ON y.name=dt.name AND y.email=dt.email
sqlite> CREATE TABLE "table"(ID,Tag1,Tag2); -- Populate table, then" select * from "table"; ID Tag1 Tag2 ---------- ---------- ---------- 1 science math 2 science algebra 3 history math 4 science math sqlite> SELECT t.id,t.tag1,t.tag2 from "table" t inner join ( SELECT Tag1, Tag2, COUNT(*) c FROM 'table' GROUP BY Tag1, Tag2 HAVING c > 1) x on t.tag1=x.tag1 and t.tag2=x.tag2; ID Tag1 Tag2 ---------- ---------- ---------- 1 science math 4 science math
Memory fault -- brain fried
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Select all duplicates from SQLite
by IB2017 (Pilgrim) on Sep 13, 2018 at 08:31 UTC |