sql - how to select for multiple column values including NULL without repeating column name? -
so far i'm doing way:
select * table_name column in(var1,var2,var3) or column null
i have issues repeating column name 2 times here since in() can't take null argument, returns no error, 0 columns. (maybe magic variables can refer last called column ?)
this:
'column'
is string literal, not column name. this:
'column' in(var1,var2,var3) or 'column' null
won't match unless var1
, var2
, or var3
happen string 'column'
. try dropping quotes on column name:
select * table_name column in (var1, var2, var3) or column null
Comments
Post a Comment