比如,我现在有以下这张表menber:
menber_id name address adddate
menberid-1 name-1 address-1 20060101
menberid-2 name-2 address-2 20010302
menberid-3 name-3 address-3 20050204
menberid-4 name-4 address-4 20040509
menberid-5 name-5 address-5 20080529
menberid-6 name-6 address-6 20020509
menberid-7 name-7 address-7 20000517
menberid-8 name-8 address-8 19990530
menberid-9 name-9 address-9 19950525.
.
.
.
menberid-n name-n address-n 20000510
我想要对以上的会员实行VIP会员和普通会员级别(目前还没有实行),我的初步设想是表增加列:dengji_id int数据类型。
然后VIP的dengji_id=1,普通会员的dengji_id=2.
按照上面的排列原则,现在可以把VIP会员和普通会员分开排列了:
select * from menber
order by dengji_id desc
可以实现总体上VIP会员在普通会员前面,如:
menber_id name address adddate dengji_id
menberid-1 name-1 address-1 20060101 1
menberid-2 name-2 address-2 20010302 1
menberid-3 name-3 address-3 20050204 1
menberid-4 name-4 address-4 20040509 2
menberid-5 name-5 address-5 20080529 2
menberid-6 name-6 address-6 20020509 2
menberid-7 name-7 address-7 20000517 2
menberid-8 name-8 address-8 19990530 2
menberid-9 name-9 address-9 19950525 2
.
.
.
menberid-n name-n address-n 20000510 2
可是如何才能在VIP会员之间(以及普通会员之间)按照adddate进行第二次排列(即按照ADDDATE降序排列)?