mysql差集

1.需求

可以理解为求两个sql的差集,通过名称+年龄判断

2.解决方法 

      2.1 通过contant

        通过contant把两个字符串拼接,再通过not in过滤

select constant(e,f) c from A  a a.c not  in(select constant(e,f) c from A  a)

        性能很差,不推荐使用

    2.2 通过表关联

如果你热衷技术,喜欢交流,欢迎加入我们! 

发布了201 篇原创文章 · 获赞 363 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/qq_16855077/article/details/102742646