select * from (
select count(*) as cnt ,all columns
(
select distinct * from table1
union all
select distinct * from table2
)
group by all columns
) where cnt =1
想把在在 db2 中,要想知道在 table1 而不再 table2 中的数据,可以 select * from table1 except select * from table2 可是现在在 mysql 下面 except 没有,用这个 select * from (
select count(*) as cnt ,all columns
(
select distinct * from table1
union all
select distinct * from table2
)
group by all columns
) where cnt =1
一直报错,也没查到 all columns 的用法。