---身上的披肩数量
select count(e1.shoulder) number from ec_role e1,ec_equipment e2 where e1.shoulder =e2.id and e2.name like '%披肩%'
---背包中的披肩数量
select count(t1.prop_id) number from ec_role_property t1, ec_equipment t2 where t1.prop_id=t2.id and t1.type='0' and t2.name like '%披肩%'
----寄售中的披肩数量
select count(t1.item_id) number from ec_merchant_second_sale t1,ec_equipment t2 where t1.item_id=t2.id and t2.name like '%披肩%'
----邮件中的披肩数量
select count(t1.equipment) number from ec_mail t1,ec_equipment t2 where t1.equipment =t2.id and t2.name like '%披肩%'如何将上面的几个number字段给加起来啊,用一条sql语句。
select count(e1.shoulder) number from ec_role e1,ec_equipment e2 where e1.shoulder =e2.id and e2.name like '%披肩%'
---背包中的披肩数量
select count(t1.prop_id) number from ec_role_property t1, ec_equipment t2 where t1.prop_id=t2.id and t1.type='0' and t2.name like '%披肩%'
----寄售中的披肩数量
select count(t1.item_id) number from ec_merchant_second_sale t1,ec_equipment t2 where t1.item_id=t2.id and t2.name like '%披肩%'
----邮件中的披肩数量
select count(t1.equipment) number from ec_mail t1,ec_equipment t2 where t1.equipment =t2.id and t2.name like '%披肩%'如何将上面的几个number字段给加起来啊,用一条sql语句。
from
(
---身上的披肩数量
select count(e1.shoulder) number from ec_role e1,ec_equipment e2 where e1.shoulder =e2.id and e2.name like '%披肩%'
union all
---背包中的披肩数量
select count(t1.prop_id) number from ec_role_property t1, ec_equipment t2 where t1.prop_id=t2.id and t1.type='0' and t2.name like '%披肩%'
union all
----寄售中的披肩数量
select count(t1.item_id) number from ec_merchant_second_sale t1,ec_equipment t2 where t1.item_id=t2.id and t2.name like '%披肩%'
union all
----邮件中的披肩数量
select count(t1.equipment) number from ec_mail t1,ec_equipment t2 where t1.equipment =t2.id and t2.name like '%披肩%'
) t
from
(
---身上的披肩数量
select count(e1.shoulder) number from ec_role e1,ec_equipment e2 where e1.shoulder =e2.id and e2.name like '%披肩%'
union all
---背包中的披肩数量
select count(t1.prop_id) number from ec_role_property t1, ec_equipment t2 where t1.prop_id=t2.id and t1.type='0' and t2.name like '%披肩%'
union all
----寄售中的披肩数量
select count(t1.item_id) number from ec_merchant_second_sale t1,ec_equipment t2 where t1.item_id=t2.id and t2.name like '%披肩%'
union all
----邮件中的披肩数量
select count(t1.equipment) number from ec_mail t1,ec_equipment t2 where t1.equipment =t2.id and t2.name like '%披肩%'
) t
(
select count(e1.shoulder) number from ec_role e1,ec_equipment e2 where e1.shoulder =e2.id and e2.name like '%披肩%'
union all
select count(t1.prop_id) number from ec_role_property t1, ec_equipment t2 where t1.prop_id=t2.id and t1.type='0' and t2.name like '%披肩%'
union all
select count(t1.item_id) number from ec_merchant_second_sale t1,ec_equipment t2 where t1.item_id=t2.id and t2.name like '%披肩%'
union all
select count(t1.equipment) number from ec_mail t1,ec_equipment t2 where t1.equipment =t2.id and t2.name like '%披肩%'
)
tt
from
(
select count(e1.shoulder) number from ec_role e1,ec_equipment e2 where e1.shoulder =e2.id and e2.name like '%披肩%'
)T1,
(
select count(t1.prop_id) number from ec_role_property t1, ec_equipment t2 where t1.prop_id=t2.id and t1.type='0' and t2.name like '%披肩%'
)T2
,
(
select count(t1.item_id) number from ec_merchant_second_sale t1,ec_equipment t2 where t1.item_id=t2.id and t2.name like '%披肩%'
)T3
,
(
select count(t1.equipment) number from ec_mail t1,ec_equipment t2 where t1.equipment =t2.id and t2.name like '%披肩%'
)
T4