0
我有以下查詢,我想把它們放在一個sql CASE語句中,所以我只有一個查詢,但我不知道該怎麼做。有人能幫助我嗎?SQL CASE語句
IF (SELECT EtlLoadId
FROM ssislogs.audit.processcontrol
WHERE SubjectArea = 'UaqaFacetsImp') > 0
SELECT pc.SrcFileName + ' - '+ CONVERT(VARCHAR(10), pc.[RecordCount]) AS FacetsImpCount
FROM ssislogs.audit.processcontrol pc left outer join
Uaqa.LettersAndCardsExports lc
on pc.etlloadid = lc.etlloadid
WHERE pc.subjectarea = 'UaqaFacetsImp'
ELSE
SELECT 'No input file' AS FacetsImpCount
SELECT pc.subjectarea AS FacetsRjctFile
FROM ssislogs.audit.processcontrol pc left outer join
Uaqa.LettersAndCardsExports lc
on pc.etlloadid = lc.etlloadid
WHERE pc.subjectarea = 'UaqaFacetsRjct'
SELECT pc.subjectarea AS FacetsPvsFile
FROM ssislogs.audit.processcontrol pc left outer join
Uaqa.LettersAndCardsExports lc
on pc.etlloadid = lc.etlloadid
WHERE pc.subjectarea = 'UaqaFacetsPvs'
感謝