日期:2014-05-18  浏览次数:20564 次

如何用一条语句实现下面的三条的效果
如何用一条语句实现下面的三条的效果
select   *   from   []   where   id   =   1;
select   *   from   []   where   id   =   3;
select   *   from   []   where   id   =   1;    


select   *   from   []   where   id   in(1,3,1)
结果只是1   3     而没有三条~



------解决方案--------------------
select * from [] where id = 1;
union all
select * from [] where id = 3;
union all
select * from [] where id = 1;
------解决方案--------------------
还是用union all
------解决方案--------------------
select * from [] where id in(1,3)
union all select * from [] where id =1