select * from student where name='abc' union all select * from student where name!='abc'或者用case when来做。
select * from tt order by if(name='abc',1,2)
or select *,if(name='abc',1,2) as sx from tt order by sx
select *,1 as sno from student where name='abc' union all select *,2 as sno from student where name!='abc' order by sno[align=center]====思想重于技巧==== [/align]
select * from student order by IF(name='abc',0,1)[align=center]====思想重于技巧==== [/align]
union all
select * from student where name!='abc'或者用case when来做。
select *,if(name='abc',1,2) as sx from tt order by sx
from student
where name='abc'
union all
select *,2 as sno
from student
where name!='abc'
order by sno[align=center]==== 思想重于技巧 ====
[/align]
from student
order by IF(name='abc',0,1)[align=center]==== 思想重于技巧 ====
[/align]