About 21,500,000 results
Open links in new tab
  1. How to Use If Else in SQL Select Statement - GeeksforGeeks

    Jan 2, 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 …

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

    Nov 22, 2024 · 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 …

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

    Sep 15, 2008 · From SQL Server 2012 you can use the IIF function for this. SELECT IIF(Obsolete = 'N' OR InStock = 'Y', 1, 0) AS Salable, * FROM Product This is effectively just a shorthand …

  4. SQL Server IF ELSE Statement By Examples

    The IF...ELSE statement is a control-flow statement that allows you to execute or skip a statement block based on a specified condition. The IF statement The following illustrates the syntax of …

  5. MySQL IF () Function - W3Schools

    Return "YES" if the condition is TRUE, or "NO" if the condition is FALSE: The IF () function returns a value if a condition is TRUE, or another value if a condition is FALSE. Required. The value …

  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. SQL IF Statement introduction and overview

    This article explores the SQL IF statement and its usage with examples to write real-time conditions based code.

  8. IF ELSE Statement – SQL Tutorial

    Here’s the basic syntax for using IF…ELSE in SQL Server: -- SQL statements to execute if the condition is TRUE. -- SQL statements to execute if the condition is FALSE. Condition: A …

  9. SQL Server IF…ELSE Condition Statement: T-SQL Select Query

    Jun 28, 2024 · IF… Else Syntax and rules in SQL Syntax: IF <Condition> {Statement | Block_of_statement} [ ELSE {Statement | Block_of_statement}] Rules: The condition should …

  10. SQL IF Statements: The Ultimate Beginners Guide [inc 4 examples]

    Oct 3, 2022 · In this article, you will see how to use the SQL IF statement for the conditional execution of your SQL script. You will see what SQL IF statements are, how to use them in …

Refresh