为质量而战!为胜利而战!

SQL Server 2000左连接left join on

上一篇 / 下一篇  2008-05-20 22:01:15 / 个人分类:Oracle和DB2

如果左表的某行在右表中没有匹配行,则在相关联的结果集中右表为NULL

已知表一:stu

 stu_id name gender
 001 张三 M
 002 李四 M

表二:borrow

 stu_id borrow_date book_name
 001 2008-05-20 C语言
   

执行以下SQL语句

selectstu.stu_id,stu.name,borrow.book_namefrom stuleft join borrowonstu.stu_id=borrow.stu_id

结果得

 stu_idname  book_name
 001 张三C语言 
 002 李四 NULL


TAG: on 左连接left join

 

评分:0

我来说两句

日历

« 2024-04-26  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 50420
  • 日志数: 64
  • 文件数: 1
  • 书签数: 1
  • 建立时间: 2008-03-28
  • 更新时间: 2009-08-14

RSS订阅

Open Toolbar