select * from product where pro_name="pro1" order by id desc 不是我要的效果 我想实现:
比如表里的id 一次为 1,2,3,5,7,9 我想查出 结果按 5,2,9,7,3,1 就是把 其中的2个特殊的放在前面 其他的 降序排列 请教大家如何写sql呢 我用的是access表
比如表里的id 一次为 1,2,3,5,7,9 我想查出 结果按 5,2,9,7,3,1 就是把 其中的2个特殊的放在前面 其他的 降序排列 请教大家如何写sql呢 我用的是access表
解决方案 »
- asp.net怎么往JS文件里传值?
- 文本文件
- 以前没做过web程序,遇到了几个基础的问题
- 如何给Radiobuttonlist 绑定数据
- 使用window.open("b.aspx","_self")打开aspx页面时,第一次可以运行b.aspx的page_load()函数,而再次使用时就不行了,什么原因啊?各位大侠帮
- 我是刚学asp.net的,我正设计个网上书店,可是有个问题,特急,希望高人帮帮忙,谢谢
- 文本文件怎么读取?
- dropdownlist绑定问题
- 我写的验证框怎么会这样?????
- 初学者ASP.NET(C#)DropDownList使用SelectedValue值时提示未实例化是什么原因
- [初学者提问]由showmodaldialog引发出来的问题
- 关于treeview展开收缩的问题 很急
我想查出 结果按 id=5,id=2,id=9,id=7,id=3,id=1 排序 就是 把id为5,id为2的放在查询结果的最前面,其他的数据按降序排列 求教了
select * from product where pro_name="pro1" and id = 2
select * from product where pro_name="pro1" and id not in(5,2) order by id desc多查几次。或者是改下表结构,加多个标记字段,例如增加type字段,特殊的置为1,其他置为0.
select * from product where pro_name="pro1" and id not in(5,2) order by type desc,id desc
union
select * from product where pro_name="pro1" and id not in (特殊) order by id desc