日期:2014-05-19  浏览次数:20509 次

这样的一个查询怎么写比较好?
表如下:
id     city     date    
1       武汉     2007-1-1    
2       武汉     2007-1-2
3       武汉     2007-6-1
4       深圳     2007-2-4
5       广州     2007-4-5
6       广州     2007-4-6
7       深圳     2007-2-5
8       武汉     2007-6-2
.....

我想查询结果按如下显示:

1       武汉     2007-1-1    
2       武汉     2007-1-2
3       武汉     2007-6-1
8       武汉     2007-6-2
4       深圳     2007-2-4
7       深圳     2007-2-5
5       广州     2007-4-5
6       广州     2007-4-6

按城市分组,组中按照日期先后排列..


------解决方案--------------------
select * from table order by city,date
------解决方案--------------------
select * from tb order by city,date
------解决方案--------------------
select * from tablename order by city,date
------解决方案--------------------
select * from tablename
order by city desc,date
------解决方案--------------------
select * from table order by city,date

------解决方案--------------------
select * from tablename
order by city desc,date
----------------------------------
转载楼上的可以吗

呵呵,接分
------解决方案--------------------
select * from tablename
order by city desc,date
----------------------------------
转载楼上的可以吗

呵呵,接分
----------------------------------
需要支付一块你那里的特产(七色彩云)邮寄给我,吼吼!