Question
SQL conditional SELECT
I would like to create a stored procedure with parameters that indicate which fields should be selected.
E.g. I would like to pass two parameters "selectField1" and "selectField2" each as bools.
Then I want something like
SELECT
if (selectField1 = true) Field1 ELSE do not select Field1
if (selectField2 = true) Field2 ELSE do not select Field2
FROM Table
Thanks Karl
45 181675
45