coco

随心。。。随性。。。随行。。。

  博客园  ::  ::  ::  ::  :: 管理

2015年4月20日

摘要: set statistics io on set statistics time on --SQL Server 2012分页方式 select * from Production.Product order by ProductID offset 20 row fetch next 10 rows... 阅读全文
posted @ 2015-04-20 22:36 深谷&幽兰 阅读(130) 评论(0) 推荐(0) 编辑

摘要: --CREATE TABLE test(code varchar(50), [name] varchar(10),[count] int )--INSERT test SELECT '001' , 'aa' ,1--UNION ALL SELECT '001' , 'bb' ,2--UNI... 阅读全文
posted @ 2015-04-20 22:35 深谷&幽兰 阅读(186) 评论(0) 推荐(0) 编辑

摘要: 我们看表的数据:而select AVG(Age) from Member1的结果为27。自己算一下就知道136/6 =22.666。而不是27,因此知道实际上Age为NULL的行没有参与运算。即:136/5=27.2。所以聚合运算会自动剔除NULL的列。那么处理办法是:select AVG(ISNU... 阅读全文
posted @ 2015-04-20 22:26 深谷&幽兰 阅读(110) 评论(0) 推荐(0) 编辑