About 179,000 results
Open links in new tab
  1. 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 …

  2. sql - Case in Select Statement - Stack Overflow

    Jan 7, 2013 · Using a SELECT statement with a searched CASE expression Within a SELECT statement, the searched CASE expression allows for values to be replaced in the result set …

  3. SQL Server CASE .. WHEN .. IN statement - Stack Overflow

    May 18, 2011 · On SQL server 2005 I am trying to query this select statement SELECT AlarmEventTransactionTableTable.TxnID, CASE AlarmEventTransactions.DeviceID WHEN …

  4. sql - Can I use CASE statement in a JOIN condition ... - Stack …

    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 …

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

  6. sql - How to filter data of CASE WHEN statement using where …

    Jan 16, 2019 · I called CASE WHEN condition as 'Operation' and now I want to see only the Operation 'X' in the Operation column. Is there a way to filter CASE WHEN condition with …

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

  8. T-SQL: Using a CASE in an UPDATE statement to update certain …

    However, if someone with a case like mine where the table have trigger for data logging on update events, this will cause problem. Both the columns will get the update and log will make …

  9. How can I SELECT multiple columns within a CASE WHEN on SQL …

    Nov 22, 2016 · This uses a delimiter '%' to split the merged columns. You can write your own split function depending on your needs (e.g. for handling null records or using complex delimiter for …

  10. How do I do multiple CASE WHEN conditions using SQL Server …

    How do I do multiple CASE WHEN conditions using SQL Server 2008? Asked 12 years, 10 months ago Modified 3 years, 5 months ago Viewed 1.7m times