How do I perform an IF...THEN in a SQL SELECT? The Problem In all programming languages, you can write an if statement similar to the following.