select name,(case when total>1000 then 'large' else 'small' end ) as type from test where name='zxhong'
解决方案 »
- 求一条SQL语句的写法
- 清理SQL日志
- 请问在winXP(SP2)上安装sqlserver2000提示只能装客户端,怎样解决?
- MSSQL INT类型时间
- Cannot drop the table 'object_name' because it is being used for replication的原因
- 前端开发问题
- 在sql server 中,像我这样的设计对性能影响大吗?
- 如果_LOG文件损坏,该怎么样再次生成一个_LOG文件。MDF文件是好的
- 在Ms Sql server 存储过程中怎样检查一个字符串是一个合法的日期时间串呢?
- sql语句问题
- 请教一个Select语句
- 如何对数据库的所有表进行更改操作?
order by total desc
先用 select * from test where name='zxhong'
将数据取出
然后通过判断 total 值对 type 赋值
最后如果你要再查询并排序的话重新执行一次 select 就行了