beechers
asked on
Need to add dummy column in query with no data values in result
I want to do a SQL query in Oracle that will add a dummy column with no data in the column. I can do the following: select file_num, name, 'dummy_column' from pd_file where file_num = '123456'. But the result comes up with a 'dummy_column' column with 'dummy_column' as the value for that field in every row. I saw a question here with the answer being to do the follwwing:
select file_num, name, null 'dummy_column' from pd_file where file_num = '123456'.
When I do that I get the following error: "ORA-00923: FROM keyword not found where expected".
I am sure there must be a way to do this simple thing. Thanks for your advice!
Susan
select file_num, name, null 'dummy_column' from pd_file where file_num = '123456'.
When I do that I get the following error: "ORA-00923: FROM keyword not found where expected".
I am sure there must be a way to do this simple thing. Thanks for your advice!
Susan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all so much! I knew there had to be a simple solution!
SQL> desc applications
Name Null? Type
--------------------------
APPLICATION_ID NOT NULL VARCHAR2(12)
APPLICATION_NAME NOT NULL VARCHAR2(50)
APPLICATION_DISPLAY_NAME NOT NULL VARCHAR2(256)
SQL> select application_id, '' nothing from applications;
APPLICATION_ N
------------ -
3M
ABS
AC
AD
BACSTEL
BAL
BKS
BLR
BWR