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!

convert char to number

916675Nov 9 2012 — edited Nov 9 2012
Hi I am using oracle 11g
create table test(location char(30),val char(10));

insert into test values('a','23');
insert into test values('b','42');
insert into test values('a','23');
insert into test values('b','5');

select location,avg(val) from test group by location.

If I am retrieving this data I am getting the error "Invalid number" when I am using group by clause.

if at particular location I am getting average.

select location,avg(val) from test group by location='a';


please suggest .........
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2012
Added on Nov 9 2012
10 comments
1,967 views