Congizant Handson - Concatenating Details

 

Concatenating Details



Write a query to display address details by concatenating address and city of students . Give an alias as Address and sort the result based on the concatenated column in descending order

Example: 

           Address - Toms Town

          City - Bangalore

Output:

           Toms Town, Bangalore

(HINT: Use student table to retrieve records.)


Solution:

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

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.