关于查询语句的排序
时间:2011-11-22
来源:互联网
我想让所有带*排在一起,order by 语句怎么写?
作者: hnymx2005 发布时间: 2011-11-22
select 姓名 FROM table1 ORDER BY case when charindex('您好',备注)>0 then '*' else '' end,备注
作者: roy_88 发布时间: 2011-11-22
select 姓名,case when charindex('您好',备注)>0 then '*' else '' end as 备注 order by 2
作者: Haiwer 发布时间: 2011-11-22
select 姓名 FROM table1 ORDER BY case when charindex('您好',备注)>0 then 1 else 2 end,备注
作者: roy_88 发布时间: 2011-11-22
作者: ssp2009 发布时间: 2011-11-22
SQL code
select 姓名,case when charindex('您好',备注)>0 then '*' else '' end as 备注 order by 2
order by 2 //按筛选的第二列排序
参考:http://topic.csdn.net/t/20061212/17/5225505.html
学习!!
作者: xiaolinyouni 发布时间: 2011-11-22
select 姓名,case when charindex('您好',备注)>0 then '*' else '' end as 备注 order by case when charindex('您好',备注)>0 then 0 else 1 end
作者: pengxuan 发布时间: 2011-11-22
sele 姓名, 备注 from tt where 备注 like %"您好"% into table mytt
update mytt set 备注='*'
由于不清楚charindex()?可能不符合楼主的意思。
作者: jxjdzwang5555 发布时间: 2011-11-22
vfp9.0:
sele 姓名, 备注 from tt where 备注 like %"您好"% into table mytt
update mytt set 备注='*'
由于不清楚charindex()?可能不符合楼主的意思。
select 姓名, 备注 from tt where 备注 like %'您好'% into table mytt
update mytt set 备注='*'
作者: xiaolinyouni 发布时间: 2011-11-22
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28