2017-08-14 83 views
-4

编写查询以显示学生的地址和城市。 Concat地址和城市并显示。举一个别名地址和排序基于所述串接的列中的结果以降序我不知道如何查询

实施例:

 Address - Toms Town 

     City - Bangalore 

输出:

 Toms Town, Bangalore 
+0

你尝试了什么? – Alexan

+0

选择concat(地址||,'||城市)作为地址 从学生顺序desc desc; – Mathumetha

回答

-1

U可以使用concat函数: -

select concat((address,','),city) as abc 
from student 
order by abc asc;