Who gives me an example of the total salary this
Select sum(to_char(salary,'9,999,999')) from employees;
Output Ora-01722
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityWho gives me an example of the total salary this
Select sum(to_char(salary,'9,999,999')) from employees;
Output Ora-01722
You are converting to character before you complete the sum, which must be done to a number. Reverse the order of your functions - do all the math before you change the data type to char:
select to_char(sum(salary),'9,999,999') from employees;