0%

SQL中UNION如何与where\and\orderby\limit联合使用呢?

SQL中UNION如何与where\and\orderby\limit联合使用呢?

union左右语句使用小括号

(SELECT a FROM t1 WHERE a=10 AND B=1 ORDER BY a LIMIT 10)
UNION
(SELECT a FROM t2 WHERE a=11 AND B=2 ORDER BY a LIMIT 10);

reference

原文博主: 热衷开源的宝藏Boy
原文链接: http://www.fangzengye.com/article/1626425093
版权声明: 自由转载-非商用-禁止演绎-保持署名| CC BY-NC-ND 3.0

评论区