11 Replies Latest reply: Feb 22, 2013 7:59 AM by John Spencer RSS

    How best we can filter null records from table

    Prince chandra
      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