select * from g_trade_tradelist
Where TradeID in (select tradeid,count(*) as log from g_trade_goodslist
where tradeid in (select tradeid from g_trade_tradelist
where tradestatus=5 and printexpress='') and log>1)
select * from g_trade_tradelist
Where TradeID in (select tradeid,count(*) as [log] from g_trade_goodslist
where tradeid in (select tradeid from g_trade_tradelist
where tradestatus=5 and printexpress='')
group by tradeid
having count(*)>1
)
select * from g_trade_tradelist
Where TradeID in (select tradeid from g_trade_goodslist
where tradeid in (select tradeid from g_trade_tradelist
where tradestatus=5 and printexpress='')
group by tradeid
having count(*)>1
)
------其他解决方案-------------------- 谢谢,我刚才自己改了一下用下面的
select * from g_trade_tradelist
where tradeid in(select tradeid from (
select tradeid,count(*) as x from g_trade_goodslist
where tradeid in(select tradeid from g_trade_tradelist
where tradestatus=5 and printexpress='')
group by tradeid)a where x>1)