select *
from tablename
order by (case colname when 3 then 0 when 7 then 1 when 8 then 2 when 1 then 3 end) desc
from tablename
order by (case colname when 3 then 0 when 7 then 1 when 8 then 2 when 1 then 3 end) desc
解决方案 »
- 刚用linq不久,想问问有没有性能测试的工具,我想比较一下不同的linq语句的速度差异有多大~~
- 一个表的记录太多该怎么办?
- libin_ftsafe(子陌红尘) ,zjcxc(邹建) ( ) 进来接分
- 请教一条SQL的语句,搜索生日者。
- 語句優化的問題
- 首字母生成问题
- 查找重复内容并返回值
- 有关like中通配符的问题
- 如何将Word文件和图像文件存入SQLSERVER
- 怎样用delphi 5读取 sql server 7.0存储过程返回的多个表
- SQLSERVER 2000 LDF文件异常变大,找不到原因何在
- 怎么做可以将SQL Sever 创建的物理文件名改成另外一个名称,作为一个新数据库,再附加,不会出现错误
select *
from tablename
order by (case colname when 3 then 0 when 7 then 1 when 8 then 2 when 1 then 3 end)