Top "Case" questions

In SQL, the CASE expression evaluates a list of conditions, returning the result for the first condition which evaluates to true.

ORA-00905: missing keyword

I am getting ORA-00905: missing keyword error when trying to run the following query in Oracle: select distinct MONTH_ID …

sql oracle case ora-00905
CASE statement with GETDATE()

Wondering if you can help a little with the syntax here. Trying to set a variable as a month value …

sql sql-server-2008 case getdate
JavaScript: Can I declare variables inside switch cases?

In C language, you cannot declare any variables inside 'case' statements. switch ( i ){ case 1: int a = 1; //error! break; } However, you …

javascript variables switch-statement case declare
RAISERROR within Case statement

Can you not raise errors within a case statement in T-SQL? I always have problems with SQL case statements :/ begin …

tsql case raiserror
Can I use .include?() in a case statement? Ruby

I have started to learn Ruby. I have a small project to build a game and tried to create a …

ruby include case case-when
SQL Conditional JOIN column

I want to determine the JOIN column based on the value of the current row. So for example, my job …

sql join case conditional-statements coalesce
What is the solution to 13th part of 'select from world' tutorial on sqlzoo?

The problem statement is: Put the continents right... Oceania becomes Australasia Countries in Eurasia and Turkey go to Europe/Asia …

sql case sql-like case-when
How can I transform a Map to a case class in Scala?

If I have a Map[String,String]("url" -> "xxx", "title" -> "yyy"), is there an way to …

class scala map case
Firebird CASE statement inside stored procedure

I was trying to use the case statement inside a stored procedure but I got "Token unknown" on it. case …

sql stored-procedures case firebird control-flow