sql2000中
select * from tb_student a,tb_score b
where (a.student_no*= b.student_no)where语句中a.student_no*= b.student_no
其中*号什么作用????????
select * from tb_student a,tb_score b
where (a.student_no*= b.student_no)where语句中a.student_no*= b.student_no
其中*号什么作用????????
where (a.student_no*= b.student_no)
等价于:
select * from tb_student a,tb_score b
where (a.student_no is null) or (a.student_no= b.student_no)
b.student_no*=a.student_no:返回b中所有的student_no,a中不在b的不返回。
select * from test1 a ,test2 b where (a.id*=b.id)服务器: 消息 4147,级别 15,状态 1,行 1
此查询使用的不是 ANSI 外部联接运算符("*=" 或 "=*")。若要不进行修改即运行此查询,请使用存储过程 sp_dbcmptlevel 将当前数据库的兼容级别设置为 80 或更低。极力建议使用 ANSI 外部联接运算符(LEFT OUTER JOIN、RIGHT OUTER JOIN)重写此查询。在将来的 SQL Server 版本中,即使在向后兼容模式下,也不支持非 ANSI 联接运算符。
select * from test1 a left join test2 b on a.id = b.id-- 一样的意思
select * from tb_student a,tb_score b
where (a.student_no*= b.student_no)
等价于:
select * from tb_student a,tb_score b
where (b.student_no is null) or (a.student_no= b.student_no)