Getting Error : ORA-01467: sort key too long
991835Mar 5 2013 — edited Mar 8 2013We are getting ORA-01467: sort key too long in one of the table TABLE_HEADER.
The above view is doing transpose of data for 400 columns and it was working fine till last week. Now getting error as ORA-01467: sort key too long.
I do not want to alter the query ,please provide a solution on how do I make the query work?
select
distinct
Table_Name,
Feed_ID,
first_value(case when Field_Display_Order = 1 then field_name end ignore nulls) over (partition by table_name ) as field_1 ,
first_value(case when Field_Display_Order = 2 then field_name end ignore nulls) over (partition by table_name ) as field_2 ,
.
.
.
.
.
.
.
.
--Upto
.
.
.
.
first_value(case when Field_Display_Order = 399 then field_name end ignore nulls) over (partition by table_name ) as field_399 ,
first_value(case when Field_Display_Order = 400 then field_name end ignore nulls) over (partition by table_name ) as field_400
from
TABLE_HEADER
where
table_name like 'STG%';