Microsoft Sql Server Left Outer Join Syntax
I apologize if this has been asked before- I searched google but could not find a concrete answer. I recently inherited a database whose t-sql code is written in a format that I find difficult to read (versus the format I have used for years). I have tested the queries below using the SQL Profiler, and both have identical costs. Is there any advantage of one format over the other? 3000 Solved Problems In Linear Algebra Pdf. Format 1: --------- SELECT * FROM Customers c, Orders o WHERE c.CustomerID = o.CustomerID Format 2: --------- SELECT * FROM Customers c INNER JOIN Orders AS o ON c.CustomerID = o.CustomerID Is it just a matter of personal preference? Does the same hold true for using OUTER JOIN versus the old *= or =*? Thanks, Matt.
The two statements you posted are logically identical. There isn't really a practical reason to prefer one over the other, it's largely a matter of personal style and readability. Some people prefer the INNER JOIN syntax and some prefer just to use WHERE. Does the same hold true for using OUTER JOIN versus the old *= or =*? You should never use the *= / =* syntax.
Comments are closed.