select a, count(b) ,count(c) from table group by a    出来的数据如下:a      count(b)     count(c)
10      2000         4000 
20      3990         28900现在我想让A字段里的10,20等数字在显示的时候变为汉字如10 变为北京,20 变为上海,但是不更新TABLE里的数据,只是在查询出来的表里改为汉字,
a      count(b)     count(c)      
北京      2000         4000
上海      3990         28900
各位有没有方法啊?麻烦写出来我看看!谢谢

解决方案 »

  1.   

    如果不麻烦的话希望你建立一个新表。
    Title
    字段 ID(自动增量),City(城市名称),CityNumber(城市编号)
    然后存入编号对应信息select Title.City, count(table.b) ,count(table.c) from table,Title where Title.CityNumber=table.a group by table.a
      

  2.   

    增加一个编码表,字段为:a,城市。
    select 编码表.城市, count(b) ,count(c) FROM [table] INNER JOIN 编码表 ON [table].a = 编码表.a group by [table].a
      

  3.   

    select case a when '10' then '北京' when '20' then '上海' end as a, count(b) ,count(c) from table group by a
      

  4.   

    大家的方法都不错但是Leftie(Leftie) 的更方便,我都会给分的谢谢啊