DB2 SQL Merge Rows in SELECT statement
<p>I have the following query for which I would like to merge rows for BusinessPhone, Fax, mobile number, email. At the moment these results are returned on separate lines. How can I achieve this?</p>

<pre><code>SELECT DISTINCT
ABAN8 as AddressNumber,
(CASE WHEN TRIM(ALADD2)!='' THEN CONCAT(CONCAT(TRIM(ALADD1),', '),(CASE WHEN     TRIM(ALADD3)!='' THEN CONCAT(CONCAT(TRIM(ALADD2),', '),(CASE WHEN TRIM(ALADD4)!='' THEN CONCAT(CONCAT(TRIM(ALADD3),', '), TRIM(ALADD4)) ELSE TRIM(ALADD3) END)) ELSE TRIM(ALADD2) END)) ELSE TRIM(ALADD1) END) AS Address,
TRIM(ALCTY1) as City,
TRIM(ALCOUN) as Country,
TRIM(ALADDZ) as PostCode,
TRIM(ABALPH) as Company,
TRIM(WWATTL) as JobTitle,
TRIM(WWGNNM) as FirstName,
TRIM(WWSRNM) as Surname,
CASE WHEN WPPHTP = 'COM' THEN WPPH1 END BusinessPhone,
CASE WHEN WPPHTP = 'FACS' THEN WPPH1 END AS FAX,
CASE WHEN WPPHTP = 'MOB' THEN WPPH1 END AS MobileNumber,
CASE WHEN WPPHTP = 'HOME' THEN WPPH1 END AS HomePhone,
CASE WHEN WPPHTP = 'EML' THEN WPPH1 END AS EmailAddress
FROM CLTDTA.F0101 
LEFT OUTER JOIN CLTDTA.F0111 ON ABAN8 = WWAN8 
LEFT OUTER JOIN CLTDTA.F0115 ON ABAN8 = WPAN8
LEFT OUTER JOIN CLTDTA.F0116 ON ABAN8 = ALAN8
WHERE 
(CLTDTA.F0101.ABAT1 = 'ST' OR CLTDTA.F0101.ABAT1 = 'SC')
</code></pre>