Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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
Comment

PREVIOUS NEXT
Code Example
Sql :: find the median in sql 
Sql :: oracle running queries 
Sql :: postgres list users and roles 
Sql :: postgresql connection string c# 
Sql :: sql find duplicate records in two tables 
Sql :: RowDataPacket 
Sql :: mariadb hours between two dates 
Sql :: restore database postgresql 
Sql :: oracle leftmost characters 
Sql :: codigo crear tablas sql server 
Sql :: sql server datetime to string 
Sql :: check index sql server 
Sql :: how to select distinct in mysql 
Sql :: restore backup to new database sql server 
Sql :: sqlite reset autoincrement 
Sql :: SQL Server Configuration Manager location 
Sql :: sqlalchemy update row 
Sql :: average sql 
Sql :: xampp mysql version 
Sql :: c# sqldatareader to list 
Sql :: psql execute sql file 
Sql :: select * where id = 1,2,3 
Sql :: ERROR: syntax error at or near "AUTO_INCREMENT" posgtresql 
Sql :: execute sp in sql server 
Sql :: 11:04:35 PM [mysql] Error: MySQL shutdown unexpectedly. 11:04:35 PM [mysql] This may be due to a blocked port, missing dependencies, 
Sql :: c# update sql statement 
Sql :: change column data type sql 
Sql :: htaccess allow index 
Sql :: alter or change postgresql sequence counter 
Sql :: creating table in mysql 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =