Hi I am new to oracle. I guess In the query [select empno, ename, sal, to_char(null) as "Transfer Date" from emp ] the fourth column is varchar where as in this query [select empno,ename,sal,tdate from emp6;] the fourth column is date . so try to_date instead of to_char.
On Sat, Feb 18, 2012 at 3:03 PM, happytoday <[email protected]> wrote: > I was running an example from some site and I completed the > requirements of that example with the below error : > select empno, ename, sal, to_char(null) as "Transfer Date" from emp > > UNION > > select empno,ename,sal,tdate from emp6; > > > > select empno, ename, sal, to_char(null) as "Transfer Date" from emp > * > > ERROR at line 1: > ORA-01790: expression must have same datatype as corresponding > expression > > > > > > > > -- > You received this message because you are subscribed to the Google > Groups "Oracle PL/SQL" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/Oracle-PLSQL?hl=en > -- You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Oracle-PLSQL?hl=en
