MySQL Forums
Forum List  »  Newbie

Re: Query trouble
Posted by: Sean Nolan
Date: July 22, 2005 09:43AM

First, you should move all the criteria that are not join criteria out of the join to the WHERE. Also you need to allow for Owner.OwnOrg to be null, so add that to the WHERE:

SELECT Project.PrjJobNumber, Project.PrjName, Project.PrjDesc, Project.PrjMarket, Project.PrjState, Project.PrjContractType, Project.PrjDelivMeth, Project.PrjValue, Project.PrjNotes, Owner.OwnOrg
FROM Project
LEFT OUTER JOIN Owner ON Project.PrjOwnerID=Owner.OwnID
WHERE (Owner.OwnOrg LIKE '%varOwn%' OR Owner.OwnOrg IS NULL) AND Project.PrjDesc LIKE '%varDesc%' AND Project.PrjState LIKE '%varState%' AND Project.PrjMarket LIKE '%varMarket%' AND Project.PrjDelivMeth LIKE '%varDog%'

Sean Nolan

Options: ReplyQuote


Subject
Written By
Posted
July 22, 2005 08:48AM
Re: Query trouble
July 22, 2005 09:43AM
July 22, 2005 01:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.