
How to Add If-Else Logic to SQL Queries - helenanders26
https://dev.to/helenanders26/sql-201-how-to-add-if-else-logic-to-sql-queries-41j
======
linkerzx
CASE statements work with most if not all SQL dialects, some dialects such as
MySQL support on top of that IF statements directly:
[https://dev.mysql.com/doc/refman/8.0/en/if.html](https://dev.mysql.com/doc/refman/8.0/en/if.html)

------
reportgunner
Also see Cross Apply and Outer Apply (MSSQL), often it is faster than using
many CASE statements

[https://www.mssqltips.com/sqlservertip/1958/sql-server-
cross...](https://www.mssqltips.com/sqlservertip/1958/sql-server-cross-apply-
and-outer-apply/)

