随笔分类 - SQL
SQL语法
摘要:https://jingyan.baidu.com/album/b2c186c8cfb077c46ff6ff67.html?picindex=1 卸载删除2005、2008 http://blog.csdn.net/chencong3139/article/details/50805235 卸载删除
阅读全文
摘要:https://jingyan.baidu.com/article/ae97a64696408abbfd461df8.html
阅读全文
摘要:http://songze39.iteye.com/blog/1404786
阅读全文
摘要:一般情况下Pivot()函数中in中只能写死,因为PIVOT()的in中不支持子查询,所以这样的话只能用存储过程来解决; CREATE PROCEDURE InsurancePivot @Foldercode VARCHAR(50), @isY VARCHAR(4) AS BEGIN DECLARE
阅读全文
摘要:use master go --1. 当前系统日期、时间 select getdate() --2.时间操作 dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值 select getdate() as '当前系统日期、时间' select dateadd(year,2,
阅读全文
摘要:如果想要在去重后选出的数据中选出前三条,则应该将distinct写在top的前面,例如 SELECT DISTINCT TOP 3 USERNAME,PASSWORD FROM USERS WHERE SEX='男'
阅读全文
摘要:如果数据库中存储的是字符类型的数据,筛选出来后如果需要进行转换float类型: convert(float,LOW) LOW代表要转换的数据 如果要将字符类型的数据转换成浮点型然后再保留两位小数: convert(decmal(18,2),convert(float,HIGH)) HIGH代表要转换
阅读全文
摘要:exists : 强调的是是否返回结果集,不要求知道返回什么, 比如: select name from student where sex = 'm' and mark exists(select 1 from grade where ...) ,只要exists引导的子句有结果集返回,那么exi
阅读全文

浙公网安备 33010602011771号