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

    Nov 18, 2025 · Transact-SQL language reference for IF-ELSE statements to provide control flow.

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

    Sep 15, 2008 · If you need to write just one condition, then iif() is sufficient, however if you want to write multiple iif() conditions within one statement then you will have to use `case' statement as …

  3. How to Execute an IF…THEN Logic in an SQL SELECT Statement

    May 28, 2024 · We can use either a CASE statement or an IIF () function to implement IF-THEN logic in SQL. In this tutorial, we’ll explore how to implement IF-THEN logic in SQL across various dialects …

  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 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 reading and return the result.

  6. 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.

  7. How to use IF...THEN logic in SQL server - Atlassian

    This is most easily accomplished in all versions of SQL Server using the CASE statement, which acts as a logical IF...THEN...ELSE expression and returns various values depending on the result.

  8. IF THEN Statement in SQL Server - From Basics to Advanced

    Jul 21, 2023 · In this article, you’ll learn the fundamentals and advanced usage of IF-THEN logic in SQL Server. We’ll walk through syntax examples, highlight common pitfalls, and share best practices.

  9. SQL SELECT IF...THEN: How to Implement Conditional Logic with CASE ...

    Dec 9, 2025 · While SQL lacks a native IF...THEN statement in the SELECT clause (unlike some programming languages), the CASE statement fills this gap, enabling powerful conditional logic …

  10. IF ELSE Statement – SQL Tutorial

    What is the IF…ELSE Statement? The IF…ELSE statement is a control-flow statement in SQL Server that enables conditional execution of T-SQL code blocks. Depending on whether a condition …