ID      Course

1 AA
1 BB
2 AA
2 BB
2 CC
3 AA
3 BB
3 CC
3 DD
4 AA
NULL NULL

选出选课数量>=2的学号

 

selectdistinctIDfromtestasA

where (Selectcount(ID)fromtestasBwhereA.ID=B.ID)>=2

 

1

2

3

posted on 2013-10-10 10:19  yangzhenping  阅读(225)  评论(0编辑  收藏  举报