sql2000中  
select * from tb_student a,tb_score b
where (a.student_no*= b.student_no)where语句中a.student_no*= b.student_no
其中*号什么作用????????

解决方案 »

  1.   

    select * from tb_student a,tb_score b
    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)
      

  2.   

    楼上错a.student_no*=b.student_no:返回a中所有的student_no,b中不在a的不返回。
    b.student_no*=a.student_no:返回b中所有的student_no,a中不在b的不返回。
      

  3.   

    *=运算符在早期的 Microsoft® SQL Server™ 2000 版本中,使用 *= 和 =* 在 WHERE 子句中指定左、右外部联接条件。有时,该语法会导致有多种解释的不明确查询。FROM 子句中指定遵从 SQL-92 的外部联接,不会导致上述不确定性。因为 SQL-92 语法更为精确,所以,本版中未包括有关在 WHERE 子句中使用旧的 Transact-SQL 外部联接语法的详细信息。以后的 SQL Server 版本可能不再支持该语法。任何使用 Transact-SQL 外部联接的语句都应改为使用 SQL-92 语法。SQL-92 标准支持 FROM 或 WHERE 子句中的内部联接规范。WHERE 子句中指定的内部联接不会出现与 Transact-SQL 外部联接语法相同的不确定性问题。
      

  4.   

    刚才用这东东出现错误  
    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 联接运算符。
      

  5.   

    -- 改为:
    select * from test1 a left join test2 b on a.id = b.id-- 一样的意思
      

  6.   

    改下:
    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)