读书人

不用union如何实现

发布时间: 2012-12-23 11:28:15 作者: rapoo

不用union怎么实现啊
(select c.* from chart as c,grel as gr where c.id=gr.tgtid and gr.srcid=840 and gr.srcType=1 and gr.tgtType=4) union (select * from chart as c where c.id in(710,722,723)) ORDER BY id DESC;
[最优解释]

select c.* from chart as c left join grel as gr on c.id=gr.tgtid where (gr.srcid=840 and gr.srcType=1 and gr.tgtType=4) or c.id in(710,722,723) ORDER BY id DESC;

读书人网 >Java相关

热点推荐