Oracle數據庫之SQL語句練習(3)

發表于:2013-05-31來源:Csdn作者:一個小菜仔點擊數: 標簽:oracle
思路:首先查詢出學號為S001學生所選 的所有課程的信息,之后進行判斷 [sql] view plaincopyprint? select t.sno,t.sname ,score.cno from student t left join score on t.sno= scor

  思路:首先查詢出學號為S001學生所選

  的所有課程的信息,之后進行判斷

  [sql] view plaincopyprint?

  select t.sno,t.sname ,score.cno from student t

  left join score on t.sno= score.sno

  where score.cno in

  (

  select distinct cno from score where sno='S001'

  )

  and t.sno <>'S001'

  ;

  select t.sno,t.sname ,score.cno from student t

  left join score on t.sno= score.sno

  where score.cno in

  (

  select distinct cno from score where sno='S001'

  )

  and t.sno <>'S001'

  ;

  第一階段的練習就到這兒了。

原文轉自:http://blog.csdn.net/kiritor/article/details/8805310

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97