Domanda di colloquio di Amazon

ID table with duplicate rows: id1,id2 Select only the duplicate rows.

Risposte di colloquio

Anonimo

15 apr 2021

SELECT ID FROM MyTable GROUP BY ID HAVING COUNT(ID) > 1

13

Anonimo

17 ago 2021

with cte as (select id, row_number() over (partition by id order by id asc ) as "Rn" from tab1) select id from tab1 where Rn > 1

1