SELECT CASE
WHEN dc.defect_code_name IS NOT NULL THEN
dc.defect_code_name
WHEN sf.second_defect_level_name IS NOT NULL THEN
sf.second_defect_level_name
WHEN fd.first_defect_level_name IS NOT NULL THEN
fd.first_defect_level_name
ELSE
''
END
FROM dual)