热门搜索
-
总结下sqlservergroupby的用法
今天用实例总结一下groupby的用法。归纳一下:groupby:ALL,Cube,RollUP,Compute,Computeby创建数据脚本CreateTableSalesInfo(Ctiynvarchar(50),OrderDatedatetime,OrderIDint)insertintoSalesInfoselectN'北京','2014-06-09',1001unionallselectN'北京','2014-08-09',1002unionallselectN'北京','2013-10-09',1009unionallselectN'大连','2013-08-09',4001unionallselectN'大连','2013-10-09',4002unionallselectN'大连','2013-05-12',4003unionallselectN'大连','2014-11-11',4004unionallselectN'大连','2014-12-11',4005首先执行以下脚本:selectCtiy,count(OrderID)asOrderCountfromSale...
数据库操作教程 2022-09-23 17:24:35