...
Code Block | ||
---|---|---|
| ||
/****** Script for SelectTopNRows command from SSMS ******/ DECLARE @StardDate DATETIMEOFFSET(7) = '2022-05-01 00:00:00 +02:00' SELECT TOP 1000 [hotelId] ,[UOM] ,[StartDateTime] ,[EndDateTime] ,[Quantity] ,[SubscriptionNumber] ,[ChargeNumber] ,[BillingPeriod] ,[AccountId] ,[Status] ,[CreateDateTime] ,[PurgeDate] ,[PreviousRetryAttemptDateTime] ,[Description] FROM [v4].[dbo].[ZuoraUsages] where uom like '%res%' and description like '%google%' and StartDateTime >= @StardDate order by hotelId asc SELECT count(1), [hotelId] FROM [v4].[dbo].[ZuoraUsages] where uom like '%res%' and description like '%google%' and StartDateTime >= @StardDate group by hotelId SELECT TOP 1000 [hotelId] ,[UOM] ,[StartDateTime] ,[EndDateTime] ,[Quantity] ,[SubscriptionNumber] ,[ChargeNumber] ,[BillingPeriod] ,[AccountId] ,[Status] ,[CreateDateTime] ,[PurgeDate] ,[PreviousRetryAttemptDateTime] ,[Description] FROM [v4].[dbo].[ZuoraUsages] where uom like '%res%' and description like '%trivago%' and StartDateTime >= @StardDate order by hotelId asc SELECT count(1), [hotelId] FROM [v4].[dbo].[ZuoraUsages] where uom like '%res%' and description like '%trivago%' and StartDateTime >= @StardDate group by hotelId /****** Script for SelectTopNRows command from SSMS ******/ SELECT TOP 1000 Z.[hotelId], HC.HotelName, HC.ZuoraTenantId ,[UOM] ,[StartDateTime] ,[EndDateTime] ,[Quantity] ,[SubscriptionNumber] ,[ChargeNumber] ,[BillingPeriod] ,[AccountId] ,[Status] ,Z.[CreateDateTime] ,[PurgeDate] ,[PreviousRetryAttemptDateTime] ,[Description] FROM [v4].[dbo].[ZuoraUsages] Z INNER JOIN v4.dbo.hotelsCache HC on z.hotelId = HC.hotelId where uom like '%payment%' and [StartDateTime] >= @StardDate order by createdatetime desc |
...