输出查询时重复列名称

时间:2012-11-14 18:34:54

标签: mysql

每当GROUP BY信息发生变化时,是否可以在执行查询时重复数据库表的列的名称?我的查询按列分组。

SELECT  name.fname as First_Name,  
  name.sales as Sales, 
  name.city as City 
FROM name 
GROUP BY city 
ORDER BY name.fname;

1 个答案:

答案 0 :(得分:0)

我想你想要这个:

SELECT  name.fname as First_Name,  
  name.sales as Sales, 
  name.city as City 
FROM name 
ORDER BY city, fname;