摘要: select * from test select ( case when len(id)>20 then name else id end ) name ,金额,数量 from (SELECT name, isnull(id,'汇总') as id, sum(金额) 金额 , SUM(数量) 数量 from (select *, cast(newid() as varchar(60)) as id from test) agroup BY name,id with CUBE ) bwhere name is not null 阅读全文
posted @ 2011-09-01 13:30 qanholas 阅读(172) 评论(0) 推荐(0)
摘要: -- Ensure a USE <databasename> statement has been executed first.SET NOCOUNT ON;DECLARE @objectid int;DECLARE @indexid int;DECLARE @partitioncount bigint;DECLARE @schemaname nvarchar(130); DECLARE @objectname nvarchar(130); DECLARE @indexname nvarchar(130); DECLARE @partitionnum bigint;DECLARE 阅读全文
posted @ 2011-09-01 13:27 qanholas 阅读(349) 评论(0) 推荐(0)