Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 3 wrz 2024 · CASE can be used in any statement or clause that allows a valid expression. For example, you can use CASE in statements such as SELECT, UPDATE, DELETE and SET, and in clauses such as <select_list>, IN, WHERE, ORDER BY, and HAVING. Transact-SQL syntax conventions.

  2. 13 cze 2021 · The complete syntax depends on the database engine you're working with: For SQL Server: CASE case-expression. WHEN when-expression-1 THEN value-1. [ WHEN when-expression-n THEN value-n ... [ ELSE else-value ] END. or: CASE. WHEN boolean-when-expression-1 THEN value-1. [ WHEN boolean-when-expression-n THEN value-n ... [ ELSE else-value ] END.

  3. The CASEexpression 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. If no conditions are true, it returns the value in the ELSEclause.

  4. SQL Server CASE expression evaluates a list of conditions and returns one of the multiple specified results. The CASE expression has two formats: simple CASE expression and searched CASE expression. Both of CASE expression formats support an optional ELSE statement.

  5. Syntax. The syntax for the CASE statement in SQL Server (Transact-SQL) is: CASE expression WHEN value_1 THEN result_1 WHEN value_2 THEN result_2 ... WHEN value_n THEN result_n ELSE result END. OR. CASE WHEN condition_1 THEN result_1 WHEN condition_2 THEN result_2 ... WHEN condition_n THEN result_n ELSE result END

  6. The first format for the CASE expression has the following syntax: CASE WHEN <condition> THEN <expression if true> ELSE <expression if false> END The ELSE argument is optional.

  7. CASE is one of the most powerful and more complex built-in expressions in Transact-SQL. Due to its name, this expression is regularly mistaken for the CASE statement available in some other languages. In SQL Server, the purpose of the CASE expression is to always return an expression.

  1. Ludzie szukają również