Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL query!
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
![]() |
![]() |