Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 28 lut 2012 · You can either put another case or use decode (as @madhu suggested): when value in (1000) then null. when user in ('ABC') then user. when area in ('DENVER') then. case when value = 2000 then 'Service1'. when value = 3000 then 'Service2'. end.

  2. 15 wrz 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 END AS bit) as Saleable, * FROM Product. You only need to use the CAST operator if you want the result as a Boolean value.

  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. 23 cze 2010 · Based on your case statement you can build a SELECT statement using a variable and then use sp_executesql to run it. The one thing to be aware of is that you need to make sure you clean any input you get from users if you are using text directly from users to prevent SQL injection attacks.

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

  6. The SQL CASE expression allows you to evaluate a list of conditions and returns one of the possible results. The CASE expression has two formats: simple CASE and searched CASE. You can use the CASE expression in a clause or statement that allows a valid expression.

  7. 2 cze 2023 · What Does the SQL CASE Statement Do? The CASE statement allows you to perform an IF-THEN-ELSE check within an SQL statement. It’s good for displaying a value in the SELECT query based on logic that you have defined.

  1. Ludzie szukają również