About 363,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. How to use Switch in SQL Server - Stack Overflow

    The CASE is just a "switch" to return a value - not to execute a whole code block. You need to change your code to something like this: SELECT @selectoneCount = CASE @Temp WHEN …

  3. SQL CASE Statement - GeeksforGeeks

    Dec 10, 2024 · In this article, we'll learn the SQL CASE statement in detail, with clear examples and use cases that show how to leverage this feature to improve your SQL queries. The CASE …

  4. Understanding SQL server switch case (With Example)

    Aug 30, 2022 · This article provides you implementation details of SQL server switch case statement and how to use it with examples

  5. How to Use the CASE Statement in SQL (With Examples)

    Learn how to use the SQL `CASE` statement to implement conditional logic efficiently. Explore its syntax, use cases, best practices, and performance considerations. What is the CASE …

  6. CASE Statement in SQL Examples - SQL Server Tips

    Apr 20, 2021 · In the T-SQL scripting language, you can use the SQL CASE statement to evaluate a condition and return one or more result expressions. This SQL Tutorial will teach …

  7. How to Use CASE statement in SQL: Explained with Examples

    Jun 28, 2023 · Here’s the general syntax for a simple case statement: WHEN value1 THEN result1. WHEN value2 THEN result2. ... ELSE default_result. With this syntax, if the …

  8. SQL CASE Expression - SQL Tutorial

    SQL allows you to use the CASE expression in the places where you can use an expression. For example, you can use the CASE expression in the clauses such as SELECT, ORDER BY, and …

  9. sql - Case in Select Statement - Stack Overflow

    Jan 7, 2013 · Within a SELECT statement, a simple CASE expression allows for only an equality check; no other comparisons are made. The following example uses the CASE expression to …

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

    Aug 20, 2024 · There are two main forms of the CASE statement: Simple CASE: Compares an expression to a set of simple expressions to determine the result. Searched CASE: Evaluates …

  11. Some results have been removed