Select * from table1
Select * from table2
Select a. *, B. * from table1 a, table2 B where a. id = B. e
-- Query if column X of Table 1 has repeated values, take only one
Select min (id) as id, B, c from table1 group by B, c order by id asc
-- 1. Search for redundant duplicate records in the Table. duplicate records are determined based on a single field (peopleId ).
Select * from table1 where B in (select B from table1 group by B having count (B)> 1)
-- 1. Search for rows with no repeated records in the table
Select * from table1 where B in (select B from table1 group by B having count (B) = 1)
Select. *, B. id, B. e from table1 a inner join (select min (id) as id, e from table2 group by e) B on. id = B. e
-- Query records associated with two tables that are not repeated
Select aa. *, bb. f from (select. *, B. ids, B. e from table1 a inner join (select min (id) as ids, e from table2 group by e) B on. id = B. e) aa inner join table2 bb on aa. ids = bb. id
Name: GoldChao