Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Joins

Author  Topic 

augustin_p
Starting Member

21 Posts

Posted - 2002-04-16 : 04:51:07
What's the difference between using 'left join ' keyword and '*=' ?

For example The below query which is possible using 'join' keyword does not seem to be possible using '*=' symbols.

select columnnlist from table1 t1 left join table2 t2
on t1.columname=t2.columnname inner join table3 t3
on t2.columname=t3.columnname

If the same is written using '*=' like

select columnlist from table1 t1, table2 t2, table3 t3
where t1.columnname *= t2.Columnname and t2.columnname = t3.columnname


It gives an error
"The table 'Table2' is an inner member of an outer-join clause. This is not allowed if the table also participates in a regular join clause."


i would like to know the difference between the way the above 2 queries executes.


Thanks,
prasanna


robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-04-16 : 08:05:31
The *= syntax is obsolete in SQL Server. It still works most of the time, but its days are numbered. One of the reasons it's obsolete is that it doesn't allow you to mix join types, like you are trying to do in this query. The JOIN syntax is not only the ANSI standard, but it also separates the JOIN logic from the WHERE logic, where the *= syntax does not separate the two.

The sooner you move your queries to the ANSI JOIN syntax, the better. At some point, when you upgrade your SQL Server, the older syntax will simply stop working, and you'll have to convert them anyway.

Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-04-16 : 08:53:08
Found this two intresting threads on *=
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=6936
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=13078

--------------------------------------------------------------
Go to Top of Page
   

- Advertisement -