Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How best we can filter null records from table

Prince chandraFeb 22 2013 — edited Feb 22 2013
Hi Team

Below are our working environment details.
Oracle version: 11.2.0.2.0
OS version : AIX 6.1

In our prod database, we have a table customer_details with 58479584 records. Its is required for us to run the below select query which is taking very much of time.

SELECT rowid FROM customer_details where trim(code) is not null;

So requesting you to please suggest the best query to get the records having the "code" column as not null. Here column code is of char(2) datatype and there is a chance of having the blank values. We need to filter this blank spaces and null values So I have used trim(code) is not null. We have unique index on customer_details table with multiple columns(composite index), one of the columns indexed is code. Thank you.

Edited by: user8895369 on Feb 22, 2013 2:21 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2013
Added on Feb 22 2013
11 comments
1,589 views