2012-11-20 62 views
-1

需要SQL查詢爲這個輸出:需要查詢這個輸出

如果位置= '奈',那麼,

A  2 
B  1 

這是我的表結構:

location    team 

chennai     A 
Bangalore    A 
Bangalore    B 
chennai     B 
madurai     B 
chennai     A 
+2

[你有什麼嘗試?](http://whathaveyoutried.com) – 2012-11-20 17:25:50

回答

2
Select team,count(team) from tb_name where location='chennai' group by team