第一个红色 select是最外围 我就想把 第二个红色 select里面的 ts字段 拿到外面来
因为第二个select有 group by 我拿不出来 谁帮我改改select channel_id stor,pk_invbasdoc inv , sum(outsale) outsale ,busi_type
from (
select channel_id, so.pk_invbasdoc,(case when new_series is not null then 1
end) outsale ,busi_type,ts from chan_saleout sa
join chan_saleout_b sab on sab.billid = sa.billid
join so_seristatus so on so.series_code=new_series or so.series_code=old_series
where sa.ts like '%' )
group by channel_id, pk_invbasdoc,busi_type gooup by
因为第二个select有 group by 我拿不出来 谁帮我改改select channel_id stor,pk_invbasdoc inv , sum(outsale) outsale ,busi_type
from (
select channel_id, so.pk_invbasdoc,(case when new_series is not null then 1
end) outsale ,busi_type,ts from chan_saleout sa
join chan_saleout_b sab on sab.billid = sa.billid
join so_seristatus so on so.series_code=new_series or so.series_code=old_series
where sa.ts like '%' )
group by channel_id, pk_invbasdoc,busi_type gooup by
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货