About 243,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 - 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 …

  3. Best way to do nested case statement logic in SQL Server

    244 I'm writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a lot of conditions. I'm currently using nested case statements, but its …

  4. CASE .. WHEN expression in Oracle SQL - Stack Overflow

    SELECT status, CASE status WHEN 'a1' THEN 'Active' WHEN 'a2' THEN 'Active' WHEN 'a3' THEN 'Active' WHEN 'i' THEN 'Inactive' WHEN 't' THEN 'Terminated' END AS StatusText …

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

  6. How do I use T-SQL's Case/When? - Stack Overflow

    Jul 27, 2010 · The original query has multiple SELECT statements, so MS SQL server is expecting subqueries. It an easy mistake to make if you're used to some programming …

  7. Can I use CASE statement in a JOIN condition? - Stack Overflow

    Apr 21, 2012 · 62 Instead, you simply JOIN to both tables, and in your SELECT clause, return data from the one that matches: I suggest you to go through this link Conditional Joins in SQL …

  8. CASE (Contains) rather than equal statement - Stack Overflow

    Jun 5, 2012 · Is there a method to use contain rather than equal in case statement? For example, I am checking a database table has an entry lactulose, Lasix (furosemide), oxazepam, …

  9. SQL Server Case Statement when IS NULL - Stack Overflow

    Jul 26, 2013 · I'm trying to do an IF statement type function in SQL server. Where there is a NULL in the field, I want it to take a field from one of the tables and add 10 days to it. And if possible …

  10. oracle sql - select statement with multiple "case when" and check …

    Jul 11, 2016 · I look for a working example where I can use mutliple when case statment wihch check to verify if a specific text is contained: e.g. SELECT ID, NAME, (SELECT (Case when …