Hi, I have a stored procedure that resembles the following structure:
SELECT projectionA
FROM TableA
JOIN
(SELECT projectionB
FROM TableB
UNION
SELECT projectionC
FROM TableC)
RIGHT JOIN TableD
The issue is this: On some occasions TableC will not be necessary. My question is this: Is there a way to deal with this so that I don't have to duplicate most of this procedure or create any new parameters?
Thank you.