Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Complicated query
On Sep 6, 10:28 am, Nick <nachiket.shirwal..._at_gmail.com> wrote:
> Hi,
>
> I have two tables Trade table and Cons table. Records are inserted in
> both the tables independent of each other. There are fields like
> Exc_Ref, Qty, Date in both the tables.
>
> I need to write a query which should give me records :
>
> 1. Where there is missing Exc_Ref value in either of the table. i.e.
> If Trade table has a Exc_Ref value but missing in Cons table then that
> record should be displayed. Similarly if Cons has a Exc_Ref value
> which is not found in Trade table then that too should be displayed.
>
> 2. In case where both the tables have matching Exc_Ref data then it
> should display the record only when the remaining column does not
> match like Qty or Date.
>
> Please help me to resolve this complicated query.
>
> Thanks
> Nick
You might try searching asktom.oracle.com for things like not exists, and the docs for outer join. Shouldn't be all that complicated. Doc search is at http://tahiti.oracle.com.
Basic guidelines for this group at http://www.dbaoracle.net/readme-cdos.htm
jg
-- @home.com is bogus. http://www.bushmaster.com/anatomy_bushmaster.aspReceived on Thu Sep 06 2007 - 13:15:45 CDT