Your syntax is wrong, or at least not standard, if you are trying to do multiple left joins.
Your ordering is not your typical for a query.
And you say "there" instead of "where".


Your query should be structure like this:

SELECT <fields>
FROM <table>, <table>,...
LEFT JOIN <table> ON <join condition>
LEFT JOIN <table> ON <join condition>
LEFT JOIN <table> ON <join condition>
...
WHERE <filter condition>

I'm surprised your query worked at all.

On Wednesday, November 12, 2003, at 05:20 PM, Kim G. Pedersen wrote:

the little Query1 works until I add the left join :

Query 1 )
  Select A.DepartmentName,A.Address,P.Postcode,P.cityname
  from caddress A,cpostinfo P
  there A.ID=10 and A.PostInfoID=P.ID


Query 2) Select A.DepartmentName,A.Address,P.Postcode,P.cityname, CP.firstname

left Join CContactPerson CP , caddresscontactperson CACP ,ccontactinfo
CCI on CP.ID =1001 and CACP.ContactpersonID=CP.ID and
CACP.AddressID=A.ID and CACP.ID=CCI.AddressContactPersonID and
CCI.AddressID=-1 and CCI.ContactInfoTypeID=1


  from caddress A,cpostinfo P
  there A.ID=10 and A.PostInfoID=P.ID


Query1 return : -> company , streeet ,2000,copenhagen


Query2 return : -> Empty

I know that the jeft join will give zero result ,
since the table caddresscontactperson are empty.

But I do not Understand Why I not get
 ->  company , streeet ,2000,copenhagen , NULL

Normally a left join should not effect ur result.

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to