Hi there!
I want to transform a table and select three columns but one of the columns might not exist in some cases. I am using this command:
SELECT 'Sprint',
'Sum of Story-points a' AS 'Work added',
'Sum of Story-points x' AS 'Work completed',
'Sum of Story-points ' AS 'Work remaining'
FROM T*
I thought I could adjust it to something like this:
SELECT 'Sprint',
if exists select t1.'Sum of Story-points a' AS 'Work added',
'Sum of Story-points x' AS 'Work completed',
'Sum of Story-points ' AS 'Work remaining'
FROM T*
But it's not working. What could I do here?