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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Query Help Needed

Re: Query Help Needed

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 4 Sep 2001 23:09:14 -0500
Message-ID: <uvgiycdxk.fsf@verizon.net>


On Tue, 04 Sep 2001, gz_at_yahoo.com wrote:

> Also how would I only return rows from a table that have
> non-matching data in a series of columns.(is there an easy way
> to do a comparison between many columns? ie In this case,
> return only people who have changed departments.

> Emp Table
> ---------
> Name Address Dept
>
> Jones 10 Main St Accounting
> Jones 10 Main St Sales
> Jones 10 Main St IT
> Smith 12 King St Marketing
>
> Query returning:
>
> Jones 10 Main St Accounting/Sales/IT
> Smith 12 King St Marketing

The query below gets you the ones that never changed their department. So, you need to get the rows from emp table where they aren't in the results of the query below.

    select address, dept
    from emp

    where fld1 = fld2
    and   fld2 = fld3
    and   fld3 = fld4

Is this enough to get you going?

-- 
Galen Boyer
It seems to me, I remember every single thing I know.
Received on Tue Sep 04 2001 - 23:09:14 CDT

Original text of this message

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