drop table filter_criterias;

create table filter_criterias(
  ID          number,
  NUMBER_KEY  number,
  STRING_KEY  varchar2(8),
  SERIES      varchar2(1),
  FIELD       varchar2(4), 
  TEXT_ITEM   varchar2(4000)
   );
   
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, 1, 'EBBR', 'F', 'LOWW', NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, 1, 'EBBR', 'A', 'LOWW', 'LOREM IPSUM');
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, 37, 'LOWW', 'A', 'EBBR', 'HELLO WORLD');
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, 37, 'LOWW', 'C', 'LOVV', 'DUMMY');
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, null, 'L', null, 'LO', null);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, NULL, 'E', NULL, NULL, NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, NULL, 'EB', 'A', NULL, NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (1, NULL, NULL, 'X', NULL, NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (2, 1, 'EBBR', 'A', NULL, NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (2, 1, 'EBBR', 'B', 'ZY', NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (2, NULL, NULL, NULL, 'A', NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (2, NULL, 'EB', NULL, 'ZY', NULL);   
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (3, 661, 'AGGH', 'A', 'ZY', NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (3, NULL, 'E', NULL, NULL, NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (3, NULL, NULL, 'B', 'A', NULL);
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (3, NULL, 'YBBB', 'A', 'XYZ', NULL); 
Insert into filter_criterias
   (ID, NUMBER_KEY, STRING_KEY, SERIES, FIELD, TEXT_ITEM)
 Values
   (3, NULL, 'Y', NULL, NULL, NULL);      
    
COMMIT;


select fc.*, fc.rowid
from filter_criterias fc
order by id, string_key nulls first, series nulls first, field, text_item;