比方說,我有如下表查找所有重複表中的行
first last value
tony jones 1
james guy 5
sara miller 6
tony jones 2
sara miller 3
joe cool 4
david marting 7
是否有一個命令來快速查詢所有重複行。
所以我最終會:
first last value
tony jones 1
tony jones 2
sara miller 6
sara miller 3
幫助!
這是我需要這個添加到查詢:
SELECT l.create_date, l.id, c.first_name, c.last_name, c.state, c.zipcode,
l.source AS 'affiliateId', ls.buyer, ls.amount FROM lead_status AS ls
INNER JOIN leads AS l ON l.id = ls.lead_id
INNER JOIN contacts AS c ON c.lead_id = l.id
WHERE ls.discriminator = 'AUTO_POST' AND l.affiliate_id=1003
AND ls.winner =1 AND l.test =0 AND l.create_date BETWEEN '2011-10-03' AND '2011-10-19';
每個第一個/最後一個組合的值是唯一的嗎? –
是的,他們只是名字和姓氏。 – ATMathew
你只想選擇或刪除重複? – user973254