mysql中union,union all 与order by 的常见用法
注意点:多个复合查询使用一个orderby时,注意用AS后的属性名才行!例如:SELECT user_name AS userName,sco_re AS score FROM t1 WHERE user_name LIKE '王%'UNIONSELECT user_name AS userName,sco_re AS score FROM t1 WHERE user_name LIK...
·
注意点:
多个复合查询使用一个orderby时,注意用AS后的属性名才行!
例如:
SELECT user_name AS userName,sco_re AS score FROM t1 WHERE user_name LIKE '王%'
UNION
SELECT user_name AS userName,sco_re AS score FROM t1 WHERE user_name LIKE '%m%' ORDER BY score ASC
具体使用见:https://www.cnblogs.com/pcheng/p/5939646.html
更多推荐
已为社区贡献1条内容
所有评论(0)