Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Query Help Needed
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