摘要: 联合结果集union (集合运算符) 最好还是使用union all。 阅读全文
posted @ 2017-07-19 12:20 Strugglinggirl 阅读(216) 评论(0) 推荐(0) 编辑
摘要: ------------------------类型转换函数------------------------ --cast(表达式 as 数据类型) --convert(数据类型,表达式) select 100.0+cast('1000' as int) select 100.0+convert(int,'1000') select '您的班级编号:'+convert(char(1),1) se... 阅读全文
posted @ 2017-07-19 09:38 Strugglinggirl 阅读(204) 评论(0) 推荐(0) 编辑
摘要: group by having SELECT 语句的处理顺序 以下步骤显示SELECT语句的处理顺序。 1、FROM 2、ON 3、JOIN 4、WHERE 5、GROUP BY 6、with cube 或with rollup 7、HAVING 8、SELECT 8-1>选择列 8-2>disti 阅读全文
posted @ 2017-07-19 08:25 Strugglinggirl 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 表中数据是集合,集合是没有顺序的。order by返回的数据是有顺序的,故此我们把order by以后返回的数据集合叫“游标”。 阅读全文
posted @ 2017-07-19 02:21 Strugglinggirl 阅读(174) 评论(0) 推荐(0) 编辑
摘要: --------------------空值处理--------------------- select * from TblStudent --查询所有年龄是null的同学学习信息 --null值无法使用 = 或 来进行比较 --unknown --判断null 值必须使用is null 或者 is not null select * from TblStudent where tsage... 阅读全文
posted @ 2017-07-19 01:47 Strugglinggirl 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 模糊查询——针对字符串 阅读全文
posted @ 2017-07-19 00:58 Strugglinggirl 阅读(170) 评论(0) 推荐(0) 编辑