Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> SQL Joins in 8i

SQL Joins in 8i

From: Aaron Rouse <aaron_rouse_at_yahoo.com>
Date: 30 Nov 2001 12:58:30 -0800
Message-ID: <a57b6daf.0111301258.2b65cbf9@posting.google.com>


I am relatively new to using Oracle 8i and come from MSSQL 7, so the syntax for joins is somewhat foriegn to me. What I want to do is a join that will grab all data from table Q and if an ID in Q is equal to that of one in table L then all of the matching records from L. The part that I am getting stuck on, is I do not want the records where the IDs in table L have a value of 0, however if the ones in table Q have a record of 0, then I need those. Hope that last sentence did not add more confusion. The following query grads everything I need with the except of the not equal zero part:

SELECT q.id, q.frm, q.question, q.qtype, L.name, q.sortorder FROM FRMQUESTIONS q, PICKLISTS L
WHERE q.LISTID(+) = L.PID
ORDER BY q.sortorder

I thought that just adding a AND L.PID != 0 would solve my problem, but that causes me to not get any of the records with a q.ListID value of 0 as well. Received on Fri Nov 30 2001 - 14:58:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US