I need to select a field called ProgramID from a table and if the ProgramID is NULL then I need to select the value in the InterimProgramID from the same table and alias it
SELECT ProgramID FROM a_table WHERE ProgramID IS NOT NULL UNION SELECT InterimProgramID AS ProgramID FROM a_table WHERE ProgramID IS NULL;