Sql Nested If Statement Same Condition For Multiple Outputs