sql - How to get NULL as values for invalid column -


i'm using sql server 2012. consider table schema be,

create table (col1 int, col2 int) 

i'm trying execute query,

select col1, col2, col3, col4 a

i execution error col3 , col4 not in table.

but there way, these 2 columns can displayed in result null value every row, though it's not available in table?

use alias each 1 of these 2 columns:

select col1, col2, null col3, null col4 

Comments