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 -> Re: SQL query!

Re: SQL query!

From: <qazmlp1209_at_rediffmail.com>
Date: 18 Jan 2007 08:56:13 -0800
Message-ID: <1169139373.315421.286940@l53g2000cwa.googlegroups.com>


Martin Gäckler wrote:
> select distinct t1.column_a
> from table_X t1
> where not exists
> (
> select *
> from table_x t4
> where t4.column_a = t1.column_a
> and t4.column_c is null
> )
> and
> (
> select count( distinct t2.column_b )
> from table_x t2
> where t1.column_a = t2.column_a
> ) <> 1
> and t1.column_a not in
> (
> select t3.column_a
> from table_x t3
> group by t3.column_a, t3.column_b
> having count(distinct column_c) > 1
> )
> ;
>
> This variant will not fetch the value 5 because there is at least one
> record with the unwanted null value.

Excellent. The solution worked perfectly. Thanks a lot! Received on Thu Jan 18 2007 - 10:56:13 CST

Original text of this message

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