mssql整理
select charindex( 'a ', 'bcad ')
1 删除女性数据
2.
SELECT * FROM Group2 where PATINDEX('%[吖-做]%',[Nick])=0 找出不包含中文汉字的记录
SELECT * FROM Group2 where not PATINDEX('%[吖-做]%',[Nick])=0 找出有包含中文汉字的记录
2 删除长度小于4 或者 大于6的
delete from Group2 where datalength(Nick)<4 delete from Group2 where datalength(Nick)=5 delete from Group2 where datalength(Nick)>6
3 删除含有26个字母和10个数字的
delete from tbl where charindex('a',ziduan)>0
4 写出含有百家姓的
select top 1 substring(Nick,0,2) as N from Group11 where id=20
insert into qq_number(QQNum,Nick,Gender,Age) select QQNum,Nick,Gender,Age from Group2 where substring(Nick,0,2)='王'
一:查询字段首位是否为汉字?
SELECT * FROM 表名WHERE ascii(字段)>127
二:查询字段是否包含汉字(任意位)?
select * from 表名 where 字段 like '%[吖-座]%'
这个可以判断是否包含汉字而不是其它双字节字符
[吖-座]是中文字符集第一个到最后一个的范围,虽然匹配准确,但是用Like的效率很低
1.删除不包含中文的
delete from Group2 where PATINDEX('%[吖-做]%',[Nick])=0
2 删除长度小于4 或者 大于6的
delete from Group2 where datalength(Nick)<4; delete from Group2 where datalength(Nick)=5; delete from Group2 where datalength(Nick)>6;
3 删除含有26个字母和10个数字的
delete from Group2 where charindex('a',Nick)>0;
delete from Group2 where charindex('b',Nick)>0;
delete from Group2 where charindex('c',Nick)>0;
delete from Group2 where charindex('d',Nick)>0;
delete from Group2 where charindex('e',Nick)>0;
delete from Group2 where charindex('f',Nick)>0;
delete from Group2 where charindex('g',Nick)>0;
delete from Group2 where charindex('h',Nick)>0;
delete from Group2 where charindex('i',Nick)>0;
delete from Group2 where charindex('j',Nick)>0;
delete from Group2 where charindex('k',Nick)>0;
delete from Group2 where charindex('l',Nick)>0;
delete from Group2 where charindex('m',Nick)>0;
delete from Group2 where charindex('n',Nick)>0;
delete from Group2 where charindex('o',Nick)>0;
delete from Group2 where charindex('p',Nick)>0;
delete from Group2 where charindex('q',Nick)>0;
delete from Group2 where charindex('r',Nick)>0;
delete from Group2 where charindex('s',Nick)>0;
delete from Group2 where charindex('t',Nick)>0;
delete from Group2 where charindex('u',Nick)>0;
delete from Group2 where charindex('v',Nick)>0;
delete from Group2 where charindex('w',Nick)>0;
delete from Group2 where charindex('x',Nick)>0;
delete from Group2 where charindex('y',Nick)>0;
delete from Group2 where charindex('z',Nick)>0;
delete from Group2 where charindex('0',Nick)>0;
delete from Group2 where charindex('1',Nick)>0;
delete from Group2 where charindex('2',Nick)>0;
delete from Group2 where charindex('3',Nick)>0;
delete from Group2 where charindex('4',Nick)>0;
delete from Group2 where charindex('5',Nick)>0;
delete from Group2 where charindex('6',Nick)>0;
delete from Group2 where charindex('7',Nick)>0;
delete from Group2 where charindex('8',Nick)>0;
delete from Group2 where charindex('9',Nick)>0;
4
insert into qq_num(QQNum,Nick,Gender) select QQNum,Nick,Gender from Group2 where substring(Nick,0,2)='王'
mssql整理的更多相关文章
- MSSQL注入常用SQL语句整理
很多情况下使用工具对mssql注入并不完善,所以我们就需要手工注入,一下是本人收集的一些mssql的sql语句. 手工MSSQL注入常用SQL语句 and exists (select * from ...
- 常用MS-SQL写法整理
这里整理日常会用到的一些写法,一些常规的group by,系统函数等用法不在这里做记录了,大家有什么好的写法也可以分享下 1 sql操作xml内容(sp_xml_preparedocument和ope ...
- 【整理】更改MSSQL默认字符集
记录所有应用到 SQL Server 实例和当前排序规则的 Service Pack 和修补程序: SELECT SERVERPROPERTY('ProductVersion ') AS Produc ...
- MSSQL数据库 1000W数据优化整理
GO SET STATISTICS TIME ON SELECT count([StyleId]) FROM [dbo].[Ky_Style] SET STATISTICS TIME OFF SET ...
- MSSQL部分补丁的列表及下载地址(持续更新)
整理了MSSQL部分补丁的列表及下载地址(截至2016-11-18),供参考下. Edition Version Date Published Download Link SQL Server 201 ...
- Kali Linux渗透基础知识整理(一):信息搜集
写在前面的废话:最近要给一些新人做培训,整理些东西,算不上什么太高端的内容,只是简单的整理下了,我觉得对于小白的话也还算是干货.在乌云水了几年,算不上什么大神水平,最近生活费紧张,现在打算在FreeB ...
- [MSSQL]如何高效查询表的总记录数
如何高效查询表的总记录数?[总结-整理-马克] 首先想到的自然是在表主键上应用COUNT函数来查询了,这个是目前使用最多的方法,没有之一 ) ROWS FROM product 这里再给出一些其它方法 ...
- 【整理】JavaEE基本框架(Struts2+Spring+MyBatis三层,Struts MVC)之间的关系
#[整理]JavaEE基本框架(Struts2+Spring+MyBatis三层,Struts MVC)之间的关系 MSSQL 各个发行版本版本号以及Compact 版本号
终于开始写博客了. 不要笑啊. 下面是MSSQL 的发行版本以及版本号.自己整理的. http://support.microsoft.com/kb/321185/zh-cn SQL Server 2 ...
随机推荐
- 一键编译go文件命令.bat
一键编译go文件命令.bat , 请新建 一键编译go文件命令.bat 文件,放到你的xxx.go文件目录下 ( 欢迎加入go语言群: 218160862 , 群内有实践) 点击加入 @e ...
- redis-cluster 迁移过程错误记录
因为集群内的 单点redis消耗 内存达到了14个G,所以需要增加新的节点,并将数据迁移过去,使用 redis-trib reshard ip:port A : 2105slot 14.5 ...
- POJ 1101 简单BFS+题意
The Game 题意: Description One morning, you wake up and think: "I am such a good programmer. Why ...
- 自己瞎捣腾的Win7下Linux安装之路-----理论篇
接着上回说道,我把双系统做好啦,开心.... 之后我就在想几个问题: 1.在Ubuntu装好后,重启电脑却还是win7,等我用EasyBCD之后,才可选择使用装好的Ubuntu呢? 2.在用EasyB ...
- UVa 221城市正视图(离散化)
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- Codeforces Round #174 (Div. 2)
A. Cows and Primitive Roots 暴力. B. Cows and Poker Game 模拟. C. Cows and Sequence 线段树维护. D. Cow Progra ...
- Majority Element II
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorit ...
- C 语言中的优先级
先看一段代码: /********************************************************************* * @fn bdAddr2Str * * ...
- 获取贴图及IES文件
最近看了一下以前写的关于收集贴图的函数...又完善了一下,老链接:http://www.cnblogs.com/3dxy/p/3988751.html fn saveusedmaps spath se ...
- JavaScript分离代码理解
window.onload=prepareLinks; //页面加载触发onload事件 function prepareLinks(){ //定义函数 var links=document.getE ...