查询SQL数据库 使用多条where语句 的到的结果排序以某一条语句优先

查询SQL数据库 使用多条where语句 的到的结果排序以某一条语句优先 想请教一下如何做到?求一个例子啊。,。
select * from student where class = 1 and(namelike edittext or namePY(姓名每个字拼音) like edittext ) 就比如是这样一条语句,写的很不标准见谅 搜索学生列表 在第一班级里面搜索 如果输入wan 这时候搜索出来的结果可能是 一个叫万某某的同学或者名字里含有某(Wan)字的同学 和一个叫王安楠的同学或者某(W)某(A)某(N) 然我结果我想把符合第二个 也是就是拼音打头的条件的同学在前面优先排序,这里要如何解决呢?

没太明白,可以再表达清楚一点

你没表达清楚,不知道知道你的意途

select *from students where class=1 and name = wan%s,是这样吗?

select *from students where class=1 and name like wan%s,是这样吗?

你可以把这两个命令分开,插入一个排序ID,再用Union连接起来排序的:

 select a.* from (
select * ,'1' as SortID from student where class = 1 and name like edittext 
union
select * ,'2' as SortID from student where class = 1 and namePY like edittext) a
order by SortID