文章分类 -  SQL Server

摘要:一:查看当前表有哪些索引?Sql Server : sp_helpindex 表名My Sql : show index from 表名 show keys from 表名 二:创建索引 普通索引:Sql Server And My Sql CREATE INDEX stu_name_index O 阅读全文
posted @ 2019-04-04 17:20 低调的奢华&Code 阅读(923) 评论(0) 推荐(0)
摘要:IS NULL 用来查询某个字段为null 列如: select * from 表名 where 字段名 is NULL ISNULL 函数 语法: ISNULL(check_expression,replacement_value) check_expression 检查的表达式, replace 阅读全文
posted @ 2018-12-31 17:02 低调的奢华&Code 阅读(2384) 评论(0) 推荐(0)
摘要:Sql server 中group by 一般和聚集函数一起使用。 列如 id name age height 27 xiaoming 18 14828 xiaoli 12 15029 xiaohei 32 17830 xiaoming 28 16731 xiaoming 28 167 我们按照 名 阅读全文
posted @ 2018-12-30 21:44 低调的奢华&Code 阅读(4760) 评论(0) 推荐(0)
摘要:1.Distinct distinct语法: select distinct 字段名称,字段名称 from 数据库名称 列子 xiaogangxiaoheixiaolixiaoming 可是我现在又想得到Id的值,改动如下 select distinct name,id from userinfo 阅读全文
posted @ 2018-12-30 15:55 低调的奢华&Code 阅读(27549) 评论(0) 推荐(1)