上一页 1 ··· 25 26 27 28 29
摘要: SQL在语法显示和执行顺序上并不一致,熟悉其的正确执行顺序,将有助于 理解一些错误的SQL语法的发生原因。以下是其执行顺序列表,优先级按照数字 排序顺序 1、From 2、On 3、Join 4、Where 5、Group By 6、With 7、Having 8、Select 9、Distinct 阅读全文
posted @ 2016-03-29 14:48 zmztyas 阅读(232) 评论(0) 推荐(0) 编辑
摘要: select * from Student;select * from Courseselect ;select* from Teacherselect ;select * from SC;--创建测试数据create table Student(S# varchar(10),Sname nvarc 阅读全文
posted @ 2016-03-29 11:35 zmztyas 阅读(898) 评论(0) 推荐(0) 编辑
摘要: 一:Union指令的目的是将两个sql语句的结果合并起来。 假设我们有以下的两个表格: Store_Information 表: store_name Sales Date Los Angeles $1500 Jan-05-1999 San Diego $250 Jan-07-1999 Los An 阅读全文
posted @ 2016-03-29 11:12 zmztyas 阅读(5813) 评论(0) 推荐(0) 编辑
摘要: 19、CAST()函数和CONVERT()函数 CAST()函数可以将某种数据类型的表达式转化为另一种数据类型 CONVERT()函数 也 可以将指定的数据类型转换为另一种数据类型 19.1 CAST()函数和CONVERT()函数语法 select cast(表达式 as 数据类型) : CAST 阅读全文
posted @ 2016-03-28 16:42 zmztyas 阅读(465) 评论(0) 推荐(0) 编辑
摘要: 存储过程必须是批处理中仅有的语句 语法: Go create Procedure 存储过程名 @参数名 参数类型(int,string...) as if(@参数名) select @参数名=count(*) from 表名 where ... else set @参数名=1000 Go 1.只返回 阅读全文
posted @ 2016-03-28 16:22 zmztyas 阅读(296) 评论(0) 推荐(0) 编辑
上一页 1 ··· 25 26 27 28 29