I want to concat columns of supplier
table with comma separator and put it into an alias field named \'contact\'. I have used cases for checking null values. Suppos
Use this
SELECT supplier_Name, supplier_Address, supplier_reference, contact_Number1,
contact_number2, contact_number3,
case when contact_number2 is null then contact_number3
when contact_number3 is null then contact_number2
when contact_number3 is null and contact_number2 is null then '0'
when contact_number2 is not null and contact_number3 is not null then contact_number2||','||contact_number3
end as contact
FROM SUPPLIER