Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. What I'm trying to do is use more than one CASE WHEN condition for the same column. Here is my code for the query: SELECT Url='', p.ArtNo, p.[Description], p.Specification, CASE WHEN 1 = 1 or 1 = 1 THEN 1 ELSE 0 END as Qty, p.NetPrice, [Status] = 0 FROM Product p (NOLOCK)

  2. The SQL CASE Expression. 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.

  3. 23 sie 2024 · Multiple CASE WHEN statements allow you to implement conditional logic in SQL queries, allowing for the evaluation of multiple conditions and the execution of different actions based on those conditions.

  4. 13 cze 2021 · Here are the CASE expression examples from the PostgreSQL docs (Postgres follows the SQL standard here): SELECT a, CASE WHEN a=1 THEN 'one' WHEN a=2 THEN 'two' ELSE 'other' END FROM test; or. SELECT a, CASE a WHEN 1 THEN 'one' WHEN 2 THEN 'two' ELSE 'other' END FROM test;

  5. 30 mar 2023 · You can use the SQL CASE WHEN statement for multiple conditions by chaining additional WHEN clauses separated by spaces or newlines. Remember to end the statement with the ELSE clause to provide a default value.

  6. 20 sie 2024 · CASE WHEN condition1 THEN result1 WHEN condition2 THEN result2 ... ELSE default_result END. Each WHEN clause specifies a condition, and if that condition is true, the corresponding THEN result is returned. If none of the conditions are true, the ELSE result is returned.

  7. 16 sty 2024 · SELECT column_name, CASE WHEN condition THEN result END AS new_column FROM your_table; Let's explain each part in detail: SELECT: Specifies the columns to be included in the result set. CASE: Evaluates the specified condition for each row in the dataset. This Initiates the conditional logic.

  1. Ludzie szukają również