SQL duplicates with different primary keys

前端 未结 7 1337
青春惊慌失措
青春惊慌失措 2021-01-24 19:56

I have a table in this form:

id | firstname | lastname
---+-----------+----------
1  | alex      | marti
2  | mark      | finger
3  | alex      | marti
4  | ted          


        
7条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-24 20:30

    select a.* from t a,
    (select first, last from t group by first, last having count(*) > 1) b
    where a.first = b.first and a.last = b.last
    

提交回复
热议问题