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!

ora-01790 Expression must have same datatype

896188May 1 2012 — edited May 1 2012
select  'sal' as A, sal as B, sal as C, sal as D
from
(Select sum(sal) sal from emp)
union all
select
  'comm', comm, comm, comm
from
(Select sum(comm) comm from emp)
union all
select rpad('-',10,'-') ,rpad('-',10,'-'),rpad('-',10,'-'),rpad('-',10,'-') from emp;
Getting following error when running the above query. I know that it is because of rpad('-',10,'-') what is the best way to acheive expected output

I would like to have the result with underline. what is the best way to acheive it.

Expected output:
I am developing report.
I need to have the following oupput.
How can i put underline after the records.
 A              B        C             D        
sal	    29025	  29025	29025
comm	2200    2200	2200
--------------------------------------------------
This post has been answered by Solomon Yakobson on May 1 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 29 2012
Added on May 1 2012
2 comments
1,801 views