Home
SQL tables should be joined with the JOIN keyword
Rule description
- SQL tables should be joined with the JOIN keyword
Non-compliant Code Example
SELECT p.Name AS ProductName, pv.Name AS VendorName FROM Production.Product p, Purchasing.ProductVendor pv; --Non compliant code (SQL JOIN conditions should involve all joined tables)
Compliant Code Example
SELECT p.Name AS ProductName, pv.Name AS VendorName FROM Production.Product p INNER JOIN Purchasing.ProductVendor pv --Compliant code (SQL JOIN conditions involving all joined tables) ON pv.Product_Id = p.Id;