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

    Nov 18, 2025 · Imposes conditions on the execution of a Transact-SQL statement. The Transact-SQL statement that follows an IF keyword and its condition is executed if the condition is …

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

  3. sql server - 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 …

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

  5. SQL Server IIF () Function - W3Schools

    Return "MORE" if the condition is TRUE, or "LESS" if the condition is FALSE: Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, …

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

  7. 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, …