Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 15 wrz 2008 · For start, you need to work out the value of true and false for selected conditions. Here comes two NULLIF : for true: ISNULL(NULLIF(p.[Instock], 'Y'), 1) for false: ISNULL(NULLIF(p.[Instock], 'N'), 0)

  2. SELECT CASE WHEN ColB = 'March' THEN (Select ColA FROM tablename WHERE ColB = 'January') END FROM tablename Or can be done without a CASE would be. SELECT (SELECT colA FROM tablename WHERE colB = 'January') FROM tablename WHERE colB = 'March' See example of second running here

  3. 28 maj 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 various dialects such as SQL Server, MySQL, and PostgreSQL.

  4. 30 paź 2023 · IIF Function: The IIF function is a concise way to implement if-else logic directly within a SELECT statement, evaluating a condition and returning specific values based on whether the condition is true or false.

  5. 7 gru 2023 · You can use a case expression like this: The database processes the expression from top-to-bottom. It returns the value for the first when clause that is true. If none are true (the percentage is less than 50 or null), it returns the value in the else clause which is F.

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