表如下:
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按城市分组,组中按照日期先后排列..
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按城市分组,组中按照日期先后排列..
order by city desc,date
insert into table_1
select 1,'武汉','2007-1-1'
union all select 2,'武汉','2007-1-2'
union all select 3,'武汉','2007-6-1'
union all select 4,'深圳','2007-2-4'
union all select 5,'广州','2007-4-5'
union all select 6,'广州','2007-4-6'
union all select 7,'深圳','2007-2-5'
union all select 8,'武汉','2007-6-2'select * from table_1
order by city desc,date
order by city desc,date
----------------------------------
转载楼上的可以吗呵呵,接分
order by city desc,date
----------------------------------
转载楼上的可以吗呵呵,接分
----------------------------------
需要支付一块你那里的特产(七色彩云)邮寄给我,吼吼!