随笔分类 - sql server写法
摘要:1.非主键字段 ALTER TABLE 表 ALTER COLUMN 要修改的字段 varchar(50) not NULL 2.主键字段 ALTER TABLE 表 DROP CONSTRAINT 主键生成的PK,类似:PK_TDCOM_USERIDRELATION; GO alter table
阅读全文
摘要:select count(*) from 表名 where 列='列条件' and 时间 between 开始时间 and 结束时间 查询结果大于0就是命中,否则没有 指定一个时间,查询是否在开始时间与结束时间之间 select count(*) from 表名 where 列='列条件' and
阅读全文
摘要:第一步:查询已安装的数据集和修改: 1.查询当前数据库的排序规则(编码) select * from ::fn_helpcollations() 2.修改方法 alter database xxx collate yyy xxx - DB name--数据库名称 yyy - 字符集 name--排序
阅读全文
摘要:with peopleInfo as( select row_number() over(order by Username) rn,* from 表 where Username='321026196902232852' ) delete from peopleInfo where rn>1
阅读全文