当前位置: 代码迷 >> Sql Server >> 很难的有关问题,高手请帮忙
  详细解决方案

很难的有关问题,高手请帮忙

热度:94   发布时间:2016-04-27 15:20:37.0
很难的问题,高手请帮忙

select   *   from   usercompanyproduct   where   ucid   in(4,4,4,9,7)  
这是我的一条语句,我想让他显示五条,可是只能显示三条,可不可以让他显示五条

------解决方案--------------------
select * from usercompanyproduct where ucid = '4 '
union all
select * from usercompanyproduct where ucid = '4 '
union all
select * from usercompanyproduct where ucid = '4 '
union all
select * from usercompanyproduct where ucid = '7 '
union all
select * from usercompanyproduct where ucid = '9 '
  相关解决方案