SELECT
a.sm AS "1",
b.sm AS "1",
c.sm AS "1",
d.sm AS "1",
e.sm AS "1",
f.sm AS "1",
g.sm AS "1",
h.sm AS "1"
FROM
(select IFNULL(sum(amount),0)*100 sm from 1 where uid = 1and item_type in(10,11) and amount < 0) a ,
(select IFNULL(sum(amount),0)*100 sm from 1 where uid = 1and item_type in(10,11) and amount < 0) b ,
(select IFNULL(sum(amount),0)*100 sm from 1 where uid = 1and item_type in(10,11) and amount < 0) c ,
(select IFNULL(sum(amount),0)*100 sm from 1 where uid = 1and item_type in(10,11) and amount < 0) d ,
(select IFNULL(sum(amount),0)*100 sm from 1 where uid = 1and item_type in(18) and amount < 0) e ,
(select IFNULL(sum(amount),0)*100 sm from x where uid = 1and item_type in(18) and amount < 0) f ,
(select IFNULL(sum(amount),0)*100 sm from x where uid = 1and item_type in(18) and amount < 0) g ,
(select IFNULL(sum(amount),0)*100 sm from x where uid = 1and item_type in(18) and amount < 0) h
子查询
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:git 配置别名
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
mysqldump 子查询 mysql子查询in
子查询指一个查询语句嵌套在另一个查询语句内部的查询,这个特性从 MySQL4.1 开始引入,在 SELECT 子句中先计算子查询,子查询结果作为外层另一个查询的过滤条件,查询可以基于一个表或者多个表。
mysqldump 子查询 mysql 链表子查询 子查询 结果集 SQL