tags:

views:

242

answers:

1

somehow I get never any results when I call: select * from table_1 t1 where t1.c1 IS NOT NULL and trim(t1.c1) != '' ;

trim(t1.c1) != '' part causes problems actually i return nothing.

+1  A: 

Oracle is peculiar in that the empty string ('') and NULL are the same thing. It is as if you are saying:

trim(t1.c1) != NULL

Such a statement will never be true. Try:

trim(t1.c1) IS NOT NULL
Adam Paynter
thx a lot, totally forgot this "feature" :)
yli
Adam Paynter