sql select duplicates based on two columns
select s.id, t.*
from [stuff] s
join (
select name, city, count(*) as qty
from [stuff]
group by name, city
having count(*) > 1
) t on s.name = t.name and s.city = t.city
sql select duplicates based on two columns
select s.id, t.*
from [stuff] s
join (
select name, city, count(*) as qty
from [stuff]
group by name, city
having count(*) > 1
) t on s.name = t.name and s.city = t.city
There are multiple records in a table and some are duplicates. Which command will fetch only one copy of the duplicate records? Pick ONE option SELECT DISTINCT SELECT UNIQUE SELECT DIFFERENT All of the above
There are multiple records in a table and some are duplicates. Which command will fetch only one copy of the duplicate records?
Pick ONE option
SELECT DISTINCT
SELECT UNIQUE
SELECT DIFFERENT
All of the above
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us