搜索内容

有一个问题?

如果您有任何疑问,可以在下面询问或输入您要寻找的!

求 SQL多表查询,能查出重复值的语句

技术聚客 未结 1 397
Chauncy799
Chauncy799 2021-03-07 23:26

1条回答
  • 2021-03-08 00:08

    SELECT A,count(A) as count FROM
    (SELECT A as A FROM table1
    UNION ALL
    SELECT B as A FROM table2
    UNION ALL
    SELECT C as A FROM table3)
    GROUP BY username HAVING count(A) >1;

    0 讨论(0)
提交回复