Hi,
I have some problem. Just new to Oracle.
I create a table
create table temp_1 (
code_cd varchar2(105),
name_cd1 varchar2(4000),
name_cd2 varchar2(4000),
col_col number
);
And then Insert into the table
insert into temp_1 values (rpad('$',105,'$'),rpad('*',4000,'*'),rpad('&',4000,'&'),1234);
Now when I do the query
select max(substr(col_col,1,2))
from temp_1
group by code_cd, name_cd1, name_cd2
Then I do not get any error but when I do this query
select avg(substr(col_col,1,2))
from temp_1
group by code_cd, name_cd1, name_cd2
Then I get the ORA-01467 Error - Sort Key Too Long.
Why is this happening. Isn't both MAX and AVG Grouping function?
Any information will be helpful.
I have some problem. Just new to Oracle.
I create a table
create table temp_1 (
code_cd varchar2(105),
name_cd1 varchar2(4000),
name_cd2 varchar2(4000),
col_col number
);
And then Insert into the table
insert into temp_1 values (rpad('$',105,'$'),rpad('*',4000,'*'),rpad('&',4000,'&'),1234);
Now when I do the query
select max(substr(col_col,1,2))
from temp_1
group by code_cd, name_cd1, name_cd2
Then I do not get any error but when I do this query
select avg(substr(col_col,1,2))
from temp_1
group by code_cd, name_cd1, name_cd2
Then I get the ORA-01467 Error - Sort Key Too Long.
Why is this happening. Isn't both MAX and AVG Grouping function?
Any information will be helpful.