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

很简单的问题求助
有一score列如下:
              score
                10
                50
              -20
              -40
             
我如何用一个语句实现的查询结果如下:
            score       score2
              10               -20
              50               -40
也就是score里实现的是> 0的数显示出来,而score2实现的是 <0的数都显示出来!谢谢



------解决方案--------------------
select id=identity(int1,1) , score into temp1 where score > 0
select id=identity(int1,1) , score into temp2 where score < 0

select temp1.score , temp2.score from temp1
full join temp2
on temp1.id = temp2.id