Commit for development environment setup
This commit is contained in:
33
PROMS/SQL/fancy query
Normal file
33
PROMS/SQL/fancy query
Normal file
@@ -0,0 +1,33 @@
|
||||
SELECT [AuditID]
|
||||
,[ContentID]
|
||||
,[Number]
|
||||
,[Text]
|
||||
,[Type]
|
||||
,[FormatID]
|
||||
,[Config]
|
||||
,[DTS]
|
||||
,[UserID]
|
||||
,[DeleteStatus]
|
||||
,DeleteDTS
|
||||
FROM [VEPROMS_JCB1].[dbo].[ContentAudits]
|
||||
where (Number is not null)-- or (Contentid not in (select contentid from contents))
|
||||
UNION
|
||||
SELECT 0 [AuditID]
|
||||
,[ContentID]
|
||||
,[Number]
|
||||
,[Text]
|
||||
,[Type]
|
||||
,[FormatID]
|
||||
,[Config]
|
||||
,[DTS]
|
||||
,[UserID]
|
||||
,[DeleteStatus]
|
||||
,DeleteDTS
|
||||
FROM [VEPROMS_JCB1].[dbo].[tblContents]
|
||||
WHERE DeleteStatus = 0 AND
|
||||
ContentID in
|
||||
(
|
||||
SELECT [ContentID]
|
||||
FROM [VEPROMS_JCB1].[dbo].[ContentAudits]
|
||||
)
|
||||
order by DTS,DeleteDTS
|
Reference in New Issue
Block a user