I need to select a column only if it exists in the table, otherwise it can be set to null.
The example table below, let's say that markscol is not necessarily there, so you need to check if it exists
Table1
name marks
joe 10
john 11
mary 13
Query:
select
name,
marks if it exists else null as marks1
from
table1
What needs to be done to choose marks?
source
share