Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

How write INNER JOIN, etc instead of using =?


How, please, do I write the following but with full compliance to the
ANSI-92 standard (or whatever it is)... i.e. with INNER JOIN, LEFT OUTER
JOIN instead of *=, etc.

SELECT *

FROM Lot l,

LotOwnerCompany loc,

OwnerCompany oc

WHERE oc.OwnerCompanyID *= @OwnerCompanyID

AND oc.OwnerCompanyID = loc.OwnerCompanyID

AND loc.LotID = l.LotID

Thanks much in advance,
Ron

Hello, Ronald

The query you posted is not a valid syntax for old-style outer joins
in SQL 2000 (which supports old-style outer joins), because "Both
terms of an outer join must contain columns" (as the error message
says). If it is a valid syntax in other products, I guess you could
write it more clearly like this:

SELECT * FROM Lot l
INNER JOIN LotOwnerCompany loc
  ON loc.LotID = l.LotID
INNER JOIN OwnerCompany oc
  ON oc.OwnerCompanyID = loc.OwnerCompanyID
WHERE
  oc.OwnerCompanyID = @OwnerCompanyID
  OR @OwnerCompanyID IS NULL

Razvan

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc