Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Left Outer Join Criteria question

Status
Not open for further replies.

padinka

Programmer
Jul 17, 2000
128
US
I am not a sybase expert but this query would work in oracle or access but doesn't work in sybase.

SELECT SW_CASE.swCaseId , DS_SURVEY.gr7RootCause, SW_CASE.grKeyword1
FROM SW_CASE , DS_SURVEY
where SW_CASE.swCaseId *= DS_SURVEY.swCaseId
and SW_CASE.swDateCreated Between '9/1/2002' And '9/10/2002'
AND SW_CASE.swStatus='Closed-Resolved'
AND (DS_SURVEY.gr7RootCause = 'MARCH' or SW_CASE.grKeyword1= 'MARCH')

I am putting criteria on both sides of the outer join. Is this not possible in sybase?
Trisha
padinka@yahoo.com
 
These kinds of queries are often rejected by the SQL compiler. The conditions (as you show them) are a bit self-contradictory since there may not be any entry from the DS_SURVEY table in the result set. You might try putting an IS NOT NULL condition on the two DS_SURVEY columns you want to match to particular values--but I'm guessing that won't work either.

One way to deal with it is to use a procedure to capture the data into a temp table and then only select out the entries that match your full set of criteria.

BOL,
J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top