Top "Case" questions

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

Conditional JOIN Statement SQL Server

Is it possible to do the following: IF [a] = 1234 THEN JOIN ON TableA ELSE JOIN ON TableB If so, what …

sql-server join conditional case
Converting to upper case. Which way is more pythonic?

Using Python 3. Which method is more Pythonic? Converting to uppercase: guess = input("\n\nEnter your guess: ") guess = guess.upper() print(…

python python-3.x case
MySQL and CASE WHEN with a range of values

I have an accounts table and a records table where accounts have multiple records. I would like to break down …

mysql case
Regular expressions in a Bash case statement

I am using following script, which uses case statement to find the server. #!/bin/bash SERVER=$1; echo $SERVER | egrep "ws-[0…

regex bash case glob
PHP switch case more than one value in the case

I have a variable that holds the values 'Weekly', 'Monthly', 'Quarterly', and 'Annual', and I have another variable that holds …

php switch-statement case
Expression inside switch case statement

I'm trying to create a switch statement but I can't seem to be able to use an expression that gets …

javascript switch-statement case
Guards vs. if-then-else vs. cases in Haskell

I have three functions that find the nth element of a list: nthElement :: [a] -> Int -> Maybe …

haskell if-statement case
MySQL Case in Select Statement with LIKE operator

Is it possible to combine the CASE statement and the LIKE operator in a MySQL SELECT statement? For Example, I …

mysql case
Laravel Eloquent Select CASE?

Is there anyone with experience in PHP & Laravel Eloquent who can help me resolve this statement? I'm trying to …

sql select laravel case eloquent
Why do we need break after case statements?

Why doesn't the compiler automatically put break statements after each code block in the switch? Is it for historical reasons? …

java switch-statement case language-design break