时间: 2021-06-24 14:31:46,108 线程ID: 128 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select VIP into ##0ae6b0b104894bbb8cf56a4bb0db1467 from CustomerVIP a where Exists(select 1 from ##5b0653ded2624d5b8f9ee10c4f0989f6 where VIP =a.VIP) and isnull(a.Input_Date,'1911-01-01')>='1900/1/1 0:00:00' and isnull(a.Input_Date,'1911-01-01')<='9999/12/31 23:59:59' ALTER TABLE ##0ae6b0b104894bbb8cf56a4bb0db1467 ADD CONSTRAINT [PK_##0ae6b0b104894bbb8cf56a4bb0db1467] PRIMARY KEY CLUSTERED (VIP ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY] 时间: 2021-06-24 14:31:46,139 线程ID: 128 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long ,Convert(Varchar(10),'S1') SIZE,SUM(ISNULL(S1,0)) as Quantity ,sum(ISNULL(S1,0)*ISNULL(b.DiscountPrice,0)) as Amount into ##838759e40b89487bbef50d22cf04e958 from [Check] a inner join CheckGoods b on a.CheckID=b.CheckID inner join CheckDetail c on b.CheckGoodsID=c.CheckGoodsID where a.Posted=1 and Exists (select 1 from ##0ae6b0b104894bbb8cf56a4bb0db1467 where VIP = a.VIP_Card) and Exists (select 1 from ##fe2b2c9068bb4d329dcb5d6576da1eb7 where Goods_No = b.Goods_No) and a.CheckDate between '2020/5/24 0:00:00' and '2021/6/24 0:00:00' group by a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long having SUM(ISNULL(S1,0))<>0 时间: 2021-06-24 14:31:46,309 线程ID: 128 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: insert into ##838759e40b89487bbef50d22cf04e958 select a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long ,'S1' SIZE,SUM(ISNULL(S1,0)) as Quantity ,sum(ISNULL(S1,0)*ISNULL(b.DiscountPrice,0)) as Amount from [CheckL] a inner join CheckLGoods b on a.CheckID=b.CheckID inner join CheckLDetail c on b.CheckGoodsID=c.CheckGoodsID where a.Posted=1 and Exists (select 1 from ##0ae6b0b104894bbb8cf56a4bb0db1467 where VIP = a.VIP_Card) and Exists (select 1 from ##fe2b2c9068bb4d329dcb5d6576da1eb7 where Goods_No = b.Goods_No) and a.CheckDate between '2020/5/24 0:00:00' and '2021/6/24 0:00:00' group by a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long having SUM(ISNULL(S1,0))<>0 时间: 2021-06-24 14:31:46,369 线程ID: 128 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: SELECT CheckID,VIP_Card,Goods_No,ColorID,Long, SIZE, SUM(Quantity) as Quantity, SUM(Amount) As Amount INTO ##799e63beb06845ddbf49175ec8f66657 FROM ##838759e40b89487bbef50d22cf04e958 GROUP BY CheckID,VIP_Card,Goods_No,ColorID,Long, SIZE 时间: 2021-06-24 14:31:46,385 线程ID: 128 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select Vip_Card,max(CheckDate) as CheckDate into ##f02db798ac764514915baafb0a87a35b from [Check] a where Exists (select 1 from ##0ae6b0b104894bbb8cf56a4bb0db1467 where VIP=a.Vip_Card) group by Vip_Card insert into ##f02db798ac764514915baafb0a87a35b select Vip_Card,max(CheckDate) as CheckDate from [CheckL] a where Exists (select 1 from ##0ae6b0b104894bbb8cf56a4bb0db1467 where VIP=a.Vip_Card) group by Vip_Card select Vip_Card,max(CheckDate) as CheckDate into ##c29c1a0df6c44d66872ecb11bf9064cf from ##f02db798ac764514915baafb0a87a35b group by Vip_Card 时间: 2021-06-24 14:31:46,407 线程ID: 128 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select IDENTITY(INT, 1, 1) AS RowNumber, A.VIP_Card AS [VIP编号], v.Name AS [姓名], g.Goods_Name AS [货品名称], sum(a.Quantity) AS [数量], count(distinct a.CheckID) AS [累计消费次数], cast(datediff(day,'2020/5/24','2021/6/24')*1.0/Count(distinct a.CheckID) as numeric(30,0)) AS [平均消费天数], sum(a.Amount) AS [生意额], case when isnull(sum(a.Quantity*g.UnitPrice),0)=0 then 0 else cast(sum(a.Amount)/sum(a.Quantity*g.UnitPrice) as numeric(30,0)) end AS [平均折扣] into tempdb.dbo.[be950db3-4e6c-4332-b953-b46dd3eaba82] from ##799e63beb06845ddbf49175ec8f66657 a inner join ##c29c1a0df6c44d66872ecb11bf9064cf b on a.Vip_Card=b.Vip_Card inner join CustomerVIP v on v.VIP=a.Vip_Card inner join Goods g on g.Goods_No=a.Goods_No inner join vGoodsColor vgc on vgc.Goods_No=a.Goods_No and vgc.ColorID=a.ColorID left join DictColor DC ON VGC.ColorID = DC.ColorID left join Customer ct on ct.Customer_ID=v.Customer_ID inner join vGoodsSize GS ON GS.GOODS_NO=A.GOODS_NO and a.size=gs.FieldName GROUP BY A.VIP_Card, v.Name, g.Goods_Name ORDER BY A.VIP_Card, v.Name, g.Goods_Name 时间: 2021-06-24 14:32:05,840 线程ID: 129 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select VIP into ##ed7e6c3d95ed4226b72382cfe05276e7 from CustomerVIP a where Exists(select 1 from ##27457643a60e4777bdcfcb4748f9d0f6 where VIP =a.VIP) and isnull(a.Input_Date,'1911-01-01')>='1900/1/1 0:00:00' and isnull(a.Input_Date,'1911-01-01')<='9999/12/31 23:59:59' ALTER TABLE ##ed7e6c3d95ed4226b72382cfe05276e7 ADD CONSTRAINT [PK_##ed7e6c3d95ed4226b72382cfe05276e7] PRIMARY KEY CLUSTERED (VIP ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY] 时间: 2021-06-24 14:32:05,865 线程ID: 129 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long ,Convert(Varchar(10),'S1') SIZE,SUM(ISNULL(S1,0)) as Quantity ,sum(ISNULL(S1,0)*ISNULL(b.DiscountPrice,0)) as Amount into ##2bcaddee36b4458b9d978d469dd76211 from [Check] a inner join CheckGoods b on a.CheckID=b.CheckID inner join CheckDetail c on b.CheckGoodsID=c.CheckGoodsID where a.Posted=1 and Exists (select 1 from ##ed7e6c3d95ed4226b72382cfe05276e7 where VIP = a.VIP_Card) and Exists (select 1 from ##9e87630f89684996a933d108652c481b where Goods_No = b.Goods_No) and a.CheckDate between '2020/5/24 0:00:00' and '2021/6/24 0:00:00' group by a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long having SUM(ISNULL(S1,0))<>0 时间: 2021-06-24 14:32:06,021 线程ID: 129 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: insert into ##2bcaddee36b4458b9d978d469dd76211 select a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long ,'S1' SIZE,SUM(ISNULL(S1,0)) as Quantity ,sum(ISNULL(S1,0)*ISNULL(b.DiscountPrice,0)) as Amount from [CheckL] a inner join CheckLGoods b on a.CheckID=b.CheckID inner join CheckLDetail c on b.CheckGoodsID=c.CheckGoodsID where a.Posted=1 and Exists (select 1 from ##ed7e6c3d95ed4226b72382cfe05276e7 where VIP = a.VIP_Card) and Exists (select 1 from ##9e87630f89684996a933d108652c481b where Goods_No = b.Goods_No) and a.CheckDate between '2020/5/24 0:00:00' and '2021/6/24 0:00:00' group by a.CheckID,a.VIP_Card,b.Goods_No,c.ColorID,c.Long having SUM(ISNULL(S1,0))<>0 时间: 2021-06-24 14:32:06,077 线程ID: 129 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: SELECT CheckID,VIP_Card,Goods_No,ColorID,Long, SIZE, SUM(Quantity) as Quantity, SUM(Amount) As Amount INTO ##789e97f114af4eae9646fe3e10420334 FROM ##2bcaddee36b4458b9d978d469dd76211 GROUP BY CheckID,VIP_Card,Goods_No,ColorID,Long, SIZE 时间: 2021-06-24 14:32:06,095 线程ID: 129 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select Vip_Card,max(CheckDate) as CheckDate into ##37b7799f353a449f96e693e0296dacdf from [Check] a where Exists (select 1 from ##ed7e6c3d95ed4226b72382cfe05276e7 where VIP=a.Vip_Card) group by Vip_Card insert into ##37b7799f353a449f96e693e0296dacdf select Vip_Card,max(CheckDate) as CheckDate from [CheckL] a where Exists (select 1 from ##ed7e6c3d95ed4226b72382cfe05276e7 where VIP=a.Vip_Card) group by Vip_Card select Vip_Card,max(CheckDate) as CheckDate into ##09c76b725fba41baaabf45eff242f08f from ##37b7799f353a449f96e693e0296dacdf group by Vip_Card 时间: 2021-06-24 14:32:06,121 线程ID: 129 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: select IDENTITY(INT, 1, 1) AS RowNumber, A.VIP_Card AS [VIP编号], v.Name AS [姓名], sum(a.Quantity) AS [数量], count(distinct a.CheckID) AS [累计消费次数], cast(datediff(day,'2020/5/24','2021/6/24')*1.0/Count(distinct a.CheckID) as numeric(30,0)) AS [平均消费天数], sum(a.Amount) AS [生意额], case when isnull(sum(a.Quantity*g.UnitPrice),0)=0 then 0 else cast(sum(a.Amount)/sum(a.Quantity*g.UnitPrice) as numeric(30,0)) end AS [平均折扣] into tempdb.dbo.[be950db3-4e6c-4332-b953-b46dd3eaba82] from ##789e97f114af4eae9646fe3e10420334 a inner join ##09c76b725fba41baaabf45eff242f08f b on a.Vip_Card=b.Vip_Card inner join CustomerVIP v on v.VIP=a.Vip_Card inner join Goods g on g.Goods_No=a.Goods_No inner join vGoodsColor vgc on vgc.Goods_No=a.Goods_No and vgc.ColorID=a.ColorID left join DictColor DC ON VGC.ColorID = DC.ColorID left join Customer ct on ct.Customer_ID=v.Customer_ID inner join vGoodsSize GS ON GS.GOODS_NO=A.GOODS_NO and a.size=gs.FieldName GROUP BY A.VIP_Card, v.Name ORDER BY A.VIP_Card, v.Name 时间: 2021-06-24 17:29:27,376 线程ID: 16 日志级别: DEBUG 对象名称: Regentsoft.Core.LoggingService 日志信息: SELECT IDENTITY(INT, 1, 1) AS RowNumber, Goods_no AS [货号], Goods_name AS [货品名称], Brand AS [品牌] ,Category AS [一级类别], Category2 AS [二级类别] ,Range [系列], Pattern [款型], Item AS [项目], Authorisation [授权] ,Season [季节], [Year] [年份], ManuFacturer 厂家编号, Sex AS [性别], UnitPrice [吊牌价] ,GoodsDate [货期], [GoodsRemark] [备注], ShutOut [停用] INTO tempdb.dbo.[3ca4a8b4-7528-4b8e-9e5d-b0883ecb4257] FROM [##512e8b99172b4322897cc3e1bbd24e42] ORDER BY Goods_no