a.area 省,
b.area 市,
b.number 数量
from
( select t.area, t.pid from t where t.id = '#' group by t.area, t.pid ) a,(
select
t.area,
t.id,
sum( t.number ) number
from
t
where
t.id <>'#'
group by
t.area,
t.id
) b
where
a.pid = b.id
答:代码如下: SELECT * FROM news_extinfo where (ExtID = 1 and OptionValue = 0) or (ExtID = 2 and OptionValue = 0 ) or (ExtID = 3 and OptionValue = 0 ) group by NewsID having count(*)=3 此处 count(*) = 3 表示的意思是 在查询的结果中...欢迎分享,转载请注明来源:内存溢出
评论列表(0条)