--方法1[set statistic ]: set statistics time on go --执行语句 xxxx go set statistics time off --方法2[getDate()]: DECLARE @begin dateTime DECLARE @end dateTime SET @begin=getdate(); BEGIN --执行语句 xxxx end set @end=getdate(); SELECT datediff(ms,@begin,@end) as
1. set statistics time on go xxxx go set statistics time off 2. DECLARE @begin dateTime DECLARE @end dateTime SET @begin=getdate(); BEGIN xxxx end set @end=getdate(); SELECT datediff(ms,@begin,@end) as 'Elapsed Time' 3. 也可以设置Query-Query options
Mysql的各个查询语句 一.where子句 语法:select *|字段列表 from 表名 where 表达式.where子句后面往往配合MySQL运算符一起使用(做条件判断) 作用:通过限定的表达式的条件对数据进行过滤,得到我们想要的结果. 1.MYSQL运算符: MySQL支持以下的运算符: 关系运算符 < > <= >= = !=(<>) 注意:这里的等于是一个等号 between and 做数值范围限定,相当于数学上的闭区间! 比如: b
一.数据库的查询语句: 1.查询整个表: select * from 表名 例: 2.通过条件查询某一行数据: select * from 表名 where 字段名 例: 3.某一列数据去重查询: select distinct 字段名 from 表名 例: 4.查询的结果按某个字段升序或倒序排列: select * from 表名 order by 字段名; 在字段名的后面加desc为降序顺序排列 例: 5.查询某一列在某个范围内的数据: select *
23个MySQL常用查询语句 一查询数值型数据: SELECT * FROM tb_name WHERE sum > 100; 查询谓词:>,=,<,<>,!=,!>,!<,=>,=< 二查询字符串 SELECT * FROM tb_stu WHERE sname = '小刘' SELECT * FROM tb_stu WHERE sname like '刘%' SELECT * FROM tb_stu WHERE sname like '%