Is it possible to select column based on the condition for dynamic queries. If condition is false, then it should not select that column. I want to write below as a dynamic query.
DECLARE @param varchar(10),
SELECT A,
IF (@param = 'U')
B = A-2, '
From Table tb
You may start with this: