Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Does *= means in WHERE Clause in TSQL?

some one have asked me the output of below query.

Select      *    
from        TableA t1, TableB t2
where       t1.Id *= t2.Id

Can anyone explain me, if such type of any query exists, if so then how its works. Because i have never seen such type of query Thanks.
UPDATE:
Also when i run this query in SQL Server, i get this;

The query uses non-ANSI outer join operators ("*=" or "=*"). 
To run this query without modification, please set the compatibility level 
for current database to 80, using the SET COMPATIBILITY_LEVEL option 
of ALTER DATABASE. 
It is strongly recommended to rewrite the query using ANSI outer join 
operators (LEFT OUTER JOIN, RIGHT OUTER JOIN). 
In the future versions of SQL Server, non-ANSI join operators will 
not be supported even in backward-compatibility modes.
like image 638
Shahid Iqbal Avatar asked Dec 16 '22 09:12

Shahid Iqbal


1 Answers

Using asterisk in a WHERE is an old non-ANSI compliant syntax for OUTER JOINing tables and therefore should not be used anymore.

Here's the link.

like image 140
Edper Avatar answered Dec 28 '22 21:12

Edper