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!

Issue with Column Alias Name in a SELECT statement

535608Jun 23 2007 — edited Jun 23 2007
I am trying to run sql query(IN ORACLE) to get the data from a remote database(TERADATA). The query is

select (table1.exp_date - table1.setup_date) AS day_diff,
CASE
WHEN day_diff = '0'
THEN 'YES'
WHEN day_diff > '0'
THEN 'NO'
ELSE 'Unknown'
END AS alias_type

from table1@remote_database_name;


The query is running fine when I run it in TERADATA environment directly without the remote database link since it is not necessary. If I run the above query in Oracle I am getting an error ORA-00904: invalid identifier.(this error is pointing to day_diff alias name)

Can anyone help me with this?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2007
Added on Jun 23 2007
6 comments
2,552 views