请各位大侠帮帮忙。谢谢
selectc.con_id,c.area_code,c.con_code,c.on_line,c.create_date,(selectcount(1)fromvalv...
select c.con_id,c.area_code,c.con_code,c.on_line,c.create_date,
(select
count(1) from valve_regular v where v.con_id=c.con_id) as vsum,
(select
count(1) from valve_regular v where v.meter_state=0 and v.con_id=c.con_id) as
verronum,
(select count(1) from valve_regular v where v.meter_state=1 and
v.con_id=c.con_id) as vsucessnum,
(select count(1) from valve_regular v where
v.meter_state=2 and v.con_id=c.con_id) as vnothingnum,
(select count(1) from
calorimeter_regular r where r.con_id=c.con_id) as csum,
(select count(1) from
calorimeter_regular r where r.meter_state=0 and r.con_id=c.con_id) as
cerronum,
(select count(1) from calorimeter_regular r where r.meter_state=1
and r.con_id=c.con_id) as csucessnum,
(select count(1) from
calorimeter_regular r where r.meter_state=2 and r.con_id=c.con_id) as
cnothingnum from concentrator c 请问这个sql语句能有更好的简便方法解决吗??? 急 。。请大侠们帮忙看下 谢谢! 展开
(select
count(1) from valve_regular v where v.con_id=c.con_id) as vsum,
(select
count(1) from valve_regular v where v.meter_state=0 and v.con_id=c.con_id) as
verronum,
(select count(1) from valve_regular v where v.meter_state=1 and
v.con_id=c.con_id) as vsucessnum,
(select count(1) from valve_regular v where
v.meter_state=2 and v.con_id=c.con_id) as vnothingnum,
(select count(1) from
calorimeter_regular r where r.con_id=c.con_id) as csum,
(select count(1) from
calorimeter_regular r where r.meter_state=0 and r.con_id=c.con_id) as
cerronum,
(select count(1) from calorimeter_regular r where r.meter_state=1
and r.con_id=c.con_id) as csucessnum,
(select count(1) from
calorimeter_regular r where r.meter_state=2 and r.con_id=c.con_id) as
cnothingnum from concentrator c 请问这个sql语句能有更好的简便方法解决吗??? 急 。。请大侠们帮忙看下 谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询