select distinct mem.firstName + ' ' + mem.lastName as fullName, mem.fspro_userId as userId from tbl_1FS_MappingQueueHistory mqh with (nolock) inner join tbl_1FS_MappingQueue mq with (nolock) on mq.queueId = mqh.queueId inner join tbl_FSPRO_Members mem with (nolock) on mem.fspro_userId = mqh.linkUserId where nullif( mq.linkId, 0 ) is null and nullif( mqh.puntReasonId, 0 ) is not null and mqh.linkLevel = and mq.operatorOwnerId = and mq.operatorOwnerType = for json auto, include_null_values