with anomalyReports as ( select distinct anomalyType, anomalyTitle, hidden from tbl_SYS_AnomalyStatus with (nolock) where ownerType = and ownerId = and hidden = 'N' and anomalyType in ( ) ) #forJSON( 'anomalyReports', attributes.datastore, 'anomalyTitle' )#