我试图从一个表中检索一列两次,例如:
select M.Event_Name as 'Male',
F.Event_Name as 'Female'
from Table1 M, Table1 F
where M.Gender = 'M'
and F.Gender = 'F'
and F.Country = 12
and M.Country = 12
表1数据
ID Event_Name Gender Country
1 Cricket M 12
2 FootBall M 13
3 BasketBall M 12
4 Hockey M 12
5 Tennis M 13
6 Volly Ball M 13
7 Cricket F 13
8 FootBall F 13
9 BasketBall F 12
10 Hockey F 13
11 Tennis F 12
12 Volly Ball F 12
我得到的是:
Male Female
Cricket Tennis
Cricket BasketBall
Cricket Volly ball
BasketBall Tennis
BasketBall BasketBall
BasketBall Volly ball
Hockey Tennis
Hockey BasketBall
Hockey Volly ball
期待:
Male Female
Cricket Tennis
BasketBall BasketBall
Hockey Volly ball
帮帮我。。谢谢