摘要: --select 查询出来的结果集可以通过as 起别名当做虚拟表来用 select*from (select*from score ,grade where score.degree between low and upp)as jibietable where rank='A' --创建视图(视图... 阅读全文
posted @ 2014-12-07 14:26 我是杨波 阅读(205) 评论(0) 推荐(3) 编辑
摘要: -定义变量 declare @sum int --变量赋值 set @sum=1 select @sum=3 --变量使用 print @sum declare @string varchar(20) set @string='abcdef' set @string=substring(@strin... 阅读全文
posted @ 2014-12-07 14:25 我是杨波 阅读(457) 评论(0) 推荐(3) 编辑
摘要: --字符串函数.返回字符串最左侧的字母的asii码print ascii('abcde')print ascii(' ')print char(97)--ascii码和字符之间的转换--*charindex查找字符串中对应字符段的开始索引,索引从1开始print charindex('de','ab... 阅读全文
posted @ 2014-12-07 14:23 我是杨波 阅读(767) 评论(0) 推荐(3) 编辑