在SQL Server 2000中,此操作数(* = star-equals)是什么? [英] What is this operand (*= star-equals) in SQL server 2000?
问题描述
我有一个查询,该查询是从ms sql 2000中提取并插入MySql查询中的.它不起作用,MySql将使* =运算符阻塞.在此示例中,我有两个名为person_name的varchar列.
I have a query that I pulled from ms sql 2000 and plugged into a MySql query. It did not work, MySql would choke on the *= operator. In this example I have two varchar columns called person_name.
SELECT * FROM tbl1 a, tbl2 b
WHERE a.id = b.id
AND a.person_name *= b.person_name
我用其他语言知道myInt * = myTotal也可以读作myInt * myInt = myTotal.但是,我正在使用包含所有字符,没有整数的varchars.我把它写成这样:
I know in other languages myInt *= myTotal could also be read as myInt * myInt = myTotal. However, I'm working with varchars that contain all chars, no integers. I wrote it out like:
AND a.person_name * a.person_name = b.person_name
Voila!它似乎起作用了.有人可以解释发生了什么吗? * =运算符是将char转换为等效的整数还是?为什么我在网络上的任何地方都找不到该运算符?
Voila! It appears to have worked. Can somebody explain what is happening? Is the *= operator converting the chars to their integer equivalents or? And why couldn't I find this operator anywhere on the web?
推荐答案
在SQL 2000中,它用作左外部联接
In SQL 2000 this was used as a LEFT OUTER JOIN
= *是正确的外部联接
=* is a RIGHT OUTER JOIN
您的查询可能是:
SELECT
*
FROM
tbl1 a LEFT OUTER JOIN tbl2 b ON a.person_name = b.person_name
WHERE
a.id = b.id
此处:
使用 非标准产品专用语法 和WHERE子句. * =运算符 用于指定左外部连接 和= *运算符用于指定 正确的外部联接.
Specifies an outer join using the nonstandard product-specific syntax and the WHERE clause. The *= operator is used to specify a left outer join and the =* operator is used to specify a right outer join.
这篇关于在SQL Server 2000中,此操作数(* = star-equals)是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!