Concatenating fields having null values
917961Feb 16 2012 — edited Feb 16 2012Hi All............
I need to concatenate four address fields(ADD1,ADD2,ADD3,ADD4) from a particular table.The output should be like ADD1,ADD2,ADD3,ADD4. I am using the || operator for this query. But if ADD3 is null the output is ADD1,ADD2,,ADD4. How to modify the query so that there is only one comma between ADD2 and ADD4. I am using the following query
select name,add1||','||add2||','||add3||','||add4,count(*) from tablename group by name,add1||','||add2||','||add3||','||add4
Could anyone please resolve this issue now? I am waiting................Thanks in adv