Reputation: 1573
I have a query, that I'm looking to select a column that doesn't exist and just fill it with "NULL" in the results. The data is being exported to a .CSV File for import to another database which has the column. For example:
My query is:
Select col1, col2, col3
from table1
Output is:
col1 col2 col3
1 5 9
2 6 10
3 7 11
4 8 12
I'd like the output to be:
col1 col2 col3 col4
1 5 9 NULL
2 6 10 NULL
3 7 11 NULL
4 8 12 NULL
Upvotes: 3
Views: 7481
Reputation: 311063
You can select a null
literal:
SELECT col1, col2, col3, NULL AS col4
FROM mytable
Upvotes: 7