Experts,
Please help, I am trying to write a view that enables a list to be produced where other views in the database have a count > 0 ... but when I run this I only get a result returned for the first WHEN statement, the others are not returned, even though they have a count > 0 ?? Help please ... suggestions on approach if I am coming at this the wrong way.
Thanks in Advance
SELECT 'VIEWS TO BE CHECKED' =
CASE
WHEN((SELECT COUNT(1) AS A FROM NN_TblToFunctionalLocationMaster) >= '0') THEN 'NN_TblToFunctionalLocationMaster'
WHEN((SELECT COUNT(1) AS A FROM OI_TblToFunctionalLocationMaster) >= '0') THEN 'OI_TblToFunctionalLocationMaster'
WHEN((SELECT COUNT(1) AS A FROM SD_TblToFunctionalLocationMaster) >= '0') THEN 'SD_TblToFunctionalLocationMaster'
WHEN((SELECT COUNT(1) AS A FROM SS_TblToFunctionalLocationMaster) >= '0') THEN 'SS_TblToFunctionalLocationMaster'
ELSE NULL
END