lanky_doodle - Wednesday, February 28, 2018 8:16 AM
What exactly are you trying to do, way too much of that code is redacted to be useful. But in general UNION does an implicit DISTINCT on the entire result set so if you have a bunch of selects in the union that all return the same constant result set if if any of them return anything you'll get a single row back with that constant result.
SELECT * FROM (VALUES ('Hello'), ('Hello')) TESTY(COL_ONE)
UNION
SELECT 'Hello'