How will a concat() in sql will add two or more arguements including special characters?

Viewed 4338
select CONCAT(address,city) as Address from student order by Address desc;

This is a query to display the address and the city with an alias name as Address from a student table

--- Program output ---

ADDRESS
----------------------------------------------------------------------
LMCCoimbatore
FFFVilupuram
BBBAgra
ABCSalem
AAAPondichery


--- Expected output (text)---
ADDRESS
------------------------------------------------------------------------
LMC, Coimbatore
FFF, Vilupuram
BBB, Agra
ABC, Salem
AAA, Pondichery

how can i add the coma and space between the city and address? when i use the third string as ', ' it is giving an invalid number of arguments error.

2 Answers
Related