登录 注册

mysql交集,并集

收藏
[Mysql] 标签: 2013-11-13 18:12
原始代码 全屏查看 0评 / 0藏 / 6476阅  跳至 / 6行
1
2
3
4
5
6
-- 交集
select table1.id,table2.name from video as table1 left join video as table2 using (name)
where table2.id is not null;

-- 并集,不重复
select name from video union select name from video2

最新评论

  · · · · · ·  (共0条)

目前还没有评论

登录后您才可以发表评论。 马上登录 立即注册
cottage
2012-02-29加入
一段精湛的代码,天涯何处寻知音!
Back to Top