sync
This commit is contained in:
21
paul_snippets/ProductionChecks/QuarantineItems_Times.sql
Normal file
21
paul_snippets/ProductionChecks/QuarantineItems_Times.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
USE SwissIndex_Products_Work
|
||||
GO
|
||||
|
||||
DECLARE @t TABLE (ItemType VARCHAR(100), IndexCode INT, Dt DATETIME, INDEX IxDt (Dt))
|
||||
INSERT INTO @t (ItemType, IndexCode, Dt)
|
||||
SELECT ItemType, IndexCode, Dt
|
||||
FROM (
|
||||
SELECT ItemType, 128 AS IndexCode, MIN(Db_InsDT) AS Dt
|
||||
FROM dbo.QuarantineItems
|
||||
WHERE NOT ItemType = 'ARTICLE'
|
||||
GROUP BY ItemType
|
||||
UNION ALL
|
||||
SELECT ItemType, IndexCode, MIN(Db_InsDT) AS Dt
|
||||
FROM dbo.QuarantineItems
|
||||
WHERE ItemType = 'ARTICLE'
|
||||
GROUP BY ItemType, IndexCode
|
||||
) g
|
||||
|
||||
SELECT * FROM @t
|
||||
ORDER BY Dt
|
||||
|
||||
Reference in New Issue
Block a user