T-SQL Conditonal Select Statement
- by msarchet
So this isn't really a normal conditional select statement. I'm helping a colleague out with some SQL and we have this issue.
I current there is a coulumn ID and a column Number. Either ID is 0 or Number is 0.
So my select statement needs to do Select colA, colB, colC, crazy part From Table A.
the crazy part is this:
(If ID > 0, ID, Number) basically select and return that column that isn't 0.
Is there any way to do this in T-SQL?