About 284,000 results
Open links in new tab
  1. 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 …

  2. SQL | Conditional Expressions - GeeksforGeeks

    Dec 3, 2024 · The CASE, DECODE, COALESCE, GREATEST, IFNULL, and LEAST functions are some of the most useful conditional expressions in SQL, enabling us to handle multiple …

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

    Sep 15, 2008 · The CASE statement is the closest to IF in SQL and is supported on all versions of SQL Server. SELECT CAST( CASE WHEN Obsolete = 'N' or InStock = 'Y' THEN 1 ELSE 0 …

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

    Jan 2, 2025 · What is IF...ELSE in SQL? The IF...ELSE statement in SQL allows conditional execution of queries or operations based on specific conditions. It evaluates a condition and …

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

  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 the CASE Statement in SQL (With Examples)

    Mar 26, 2025 · Learn how to use the SQL `CASE` statement to implement conditional logic efficiently. Explore its syntax, use cases, best practices, and performance considerations.

  8. SQL CASE Examples with Multiple Conditions - Database.Guide

    Aug 20, 2024 · Understanding the CASE Statement. The CASE statement in SQL is a conditional statement that allows us to specify conditions and return different values based on whether …

  9. Conditional Statements in SQL | If Statements in SQL - Simplilearn

    Aug 9, 2024 · Common SQL conditional statements include the CASE statement, the IF statement, and the NULLIF statement. Each has its unique use case and syntax, which we will …

  10. SQL SERVER | Conditional Statements - GeeksforGeeks

    Jan 27, 2022 · The CASE statement in SQL is a versatile conditional expression that enables us to incorporate conditional logic directly within our queries. It allows you to return specific …

  11. Some results have been removed
Refresh