select id,
uname,
sex
FROM
USER u
where (id,uname,sex)not in
(
SELECT
u1.id as id,u1.uname as uname,u1.sex as sex
FROM
USER u1,
(
SELECT
*
FROM
user2
UNION
SELECT
*
FROM
user3
) AS u2
WHERE
u1.id = u2.id
AND u1.sex = u2.sex
AND u1.uname = u2.uname
)
三张表user,user2,user3结构相同,找出user表中与user2,user3表不相同的数据。
最新推荐文章于 2023-07-26 15:45:04 发布