XXXXX
C/C++
XXXXX
C#/.net
XXXXX
js
java
java
开发导航 开发导航 www.endv.cn
天云

mysql 多表多字段报表填充查询

mysql 多表多字段报表填充查询

当需要2个数据从不同表时:

select *
from (  select count(id)as org_sum  FROM `jnx_drive` WHERE  user_id =1 and drive_type =1)as a1,
     ( select sum(money)as money,sum(score)as score FROM `sys_user`)as a2

 

继续添加字段:

,(SELECT count(id) FROM org WHERE user_id = "test_user_id"  and is_disable = 0  order by id DESC  )as a3

 

posted @ 2021-11-24 19:28  Endv  阅读(71)  评论(0编辑  收藏  举报