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 -> Complex logic query that I cannot figure out:(

Complex logic query that I cannot figure out:(

From: MrHelpMe <clinttoris_at_hotmail.com>
Date: Tue, 11 Dec 2007 14:41:08 -0800 (PST)
Message-ID: <543b0e9c-a92d-40c6-8f66-91f90215b1b4@d4g2000prg.googlegroups.com>


Hello again experts,

I am working on a query that pulls from 3 tables.

Table 1 - houses all user information
Table 2 - houses all counts for the users
Table 3 - houses all user info. for those users that are unique.

I have three parameter ID, Status and Group

I am trying to figure out how to write my query so that if a user selects a set of 3 parameters it pulls from Table 1 for example and if he/she chooses another set of 3 parameters it pulls from table 3 ect.

Here is my query that hopefully someone could help me finish. I am using oracle 9.2

Select a.ID,

          a.Name,
          b.ID

FROM
         Table 1 a
LEFT OUTER JOIN
         Table 2 b
ON
        a.id = b.id

RIGHT OUTER JOIN Table 3 c
ON

       a.id = c.id
WHERE
       a.id in ID
AND
       a.status in STATUS
AND

If someone could figure this out this would be most appreciated. Thanks. Received on Tue Dec 11 2007 - 16:41:08 CST

Original text of this message

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