2011-04-26 138 views
1

我使用SQL Server 2000中我的表看起来像这样:SQL Server查询问题

stricker nonstricker over  status 
----------------------------------------------- 
sahwag  sachin  0.1  out(sahwag) 
kohli  sachin  0.2  not out 

我想要的击球手的名字,像这样:

------------------ 
sahwag 
sachin 
kohli 
+4

OMG,发生了什么事情! – Homam 2011-04-26 07:13:45

+0

哪些人是击球手?我不完全是一个板球爱好者... – alex 2011-04-26 07:15:34

+0

我不知道如何以2列单列多行结合起来。 – Pramod 2011-04-26 07:18:20

回答

3

我觉得这是什么你要。这将得到表中的strkers和nonstrickers:

select stricker from myTable 
union 
select nonstricker from myTable 
+0

谢谢亚历...这是我的问题的答案...非常感谢 – Pramod 2011-04-26 07:22:06

+0

我试图投票,但我不能投票bcoz我的名誉......对不起朋友 – Pramod 2011-04-26 07:24:38

+0

@Pramod的:那么就标志着答案被接受(在投票箭头下面的大复选标记)。这也会给你2个重点。 – alex 2011-04-26 07:25:41