When the exchCode is empty the record shouldn't be displayed. However the code below display the records.
SELECT * FROM(
SELECT
bhCliCode,
exchCode =
CASE X.Which
WHEN 'accSgx' THEN accSgx
WHEN 'accHk' THEN accHk
WHEN 'accIdx' THEN accIdx
WHEN 'accUs' THEN accUs
WHEN 'accSet' THEN accSet
WHEN 'accPhp' THEN accPhp
END
FROM
ds_lobclient
CROSS JOIN (
SELECT 'accSgx'
UNION ALL
SELECT 'accHk'
UNION ALL
SELECT 'accIdx'
UNION ALL
SELECT 'accUs'
UNION ALL
SELECT 'accSet'
UNION ALL
SELECT 'accPhp'
)
X (Which)
) t
where exchCode is not null
How do I solve this problem?. Your help is kindly appreciated.
Thank You.