About 968,000 results
Open links in new tab
  1. SQL Case Expression Syntax? - Stack Overflow

    Aug 7, 2008 · case expression is the correct term as they evaluate to a scalar value (also. in SQL a statement is terminated by the "statement terminator" which is the semi-colon).

  2. SQL use CASE statement in WHERE IN clause - Stack Overflow

    Oct 9, 2013 · You can use case in a where, but not like that. Case has to return one value per statement.

  3. sql - Case in Select Statement - Stack Overflow

    Jan 7, 2013 · I have an SQL statement that has a CASE from SELECT and I just can't get it right. Can you guys show me an example of CASE where the cases are the conditions and the results are from …

  4. SQL Switch/Case in 'where' clause - Stack Overflow

    Oct 16, 2008 · In SQL the rest of the expression does get evaluated in the OR syntax. Try this (it wouldn't let me include the @ symbol - you will have to correct it if you want to test it): declare var …

  5. SQL: How use case and cast in a query? - Stack Overflow

    Aug 23, 2013 · I want to cast VARCHAR to INT, but in my table i have some value like '???' then SQL Server launch this expcetion : Conversion failed when converting the varchar value '????' to data …

  6. sql - Can I use CASE statement in a JOIN condition ... - Stack Overflow

    Apr 21, 2012 · The following image is a part of Microsoft SQL Server 2008 R2 System Views. From the image we can see that the relationship between sys.partitions and sys.allocation_units depends on …

  7. sql - What is SELF JOIN and when would you use it? - Stack Overflow

    Jun 13, 2024 · You use a self join when a table references data in itself. E.g., an Employee table may have a SupervisorID column that points to the employee that is the boss of the current employee. To …

  8. Is it possible to use a Case statement in a sql From clause

    Apr 14, 2012 · 8 Assuming SQL Server: You would need to use dynamic SQL. Build the string and then call sp_executesql with the string. Edit: Better yet, just use if statements to execute the appropriate …

  9. I want to use CASE statement to update some records in sql server 2005

    Apr 2, 2013 · I want to use CASE statement to update some records in sql server 2005 Asked 12 years, 8 months ago Modified 1 year, 1 month ago Viewed 986k times

  10. sql - How Do I Use Case Statement Column In Group By - Stack Overflow

    Nov 27, 2013 · As stated by the question, I'm trying to formulate a query that has a case statement in the column results, and then I want to include that column in the query's group by statement. To give …