About 1,220,000 results
Open links in new tab
  1. IF...ELSE (Transact-SQL) - SQL Server | Microsoft Learn

    Nov 18, 2025 · Unless a statement block is used, the IF or ELSE condition can affect the performance of only one Transact-SQL statement. To define a statement block, use the control-of-flow keywords …

  2. How do I perform an IF...THEN in an SQL SELECT?

    Sep 15, 2008 · Looks like an old question, however if I understood your question and thought correctly, you want to implement the if/else conditional statement in SQL. Both are calculated as a separate …

  3. SQL Server IF ELSE Statement By Examples

    This tutorial shows you how to use the SQL Server IF...ELSE statement to control the flow of a program.

  4. How to Use If Else in SQL Select Statement - GeeksforGeeks

    Jul 23, 2025 · By using IF...ELSE within SQL statements we can categorize data, apply conditional transformations, and implement business logic directly in our queries. In this article, We will explain …

  5. SQL CASE Expression - W3Schools

    The SQL CASE Expression The CASE expression goes through conditions and returns a value when the first condition is met (like an if-then-else statement). So, once a condition is true, it will stop …

  6. The IF…ELSE IF….ELSE Statement: Everything You Should Know

    May 24, 2021 · The IF...ELSE IF...ELSE decision structure is one of the most helpful SQL Server Decision Structures you should know.

  7. ELSE (IF...ELSE) (Transact-SQL) - SQL Server | Microsoft Learn

    Nov 18, 2025 · ELSE (IF...ELSE) imposes conditions on the execution of a Transact-SQL statement.

  8. MySQL IF () Function - W3Schools

    Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.

  9. SQL IF Statement for Conditional Logic - SQL Server Tips

    Sep 12, 2022 · Learn how to build conditional logic when writing T-SQL code using IF, BEGIN, END, ELSE, and ELSEIF logic.

  10. T-SQL How to end an IF-ELSE IF-ELSE block - Stack Overflow

    Sep 17, 2015 · When I run the below procedure with the correct parameters so that the -1 value isn't returned, none of my DML statements are firing. I'm guessing that it's treating all my DML statements …