Top "Case" questions

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

SQL query to conditionally sum based on moving date window

I'm trying to figure out some sliding window stats on my users. I have a table with a user, and …

sql postgresql case
Reverse Polish Notation Java

I want to make Reverse Polish Notation algorithm, but my code isn't working. Can anyone explain me why ? In my …

stack switch-statement case token rpn
c# switch statement is return suitable to replace break

Is this an appropriate way to handle c# switch statements or is an explicit break required still? reference public static …

c# case switch-statement
switch-case statement for STRINGS in Python

I need to do something similar to the CASE WHEN .. OR .. THEN from SQL in python for STRINGS. For example, …

python dictionary switch-statement case type-synonyms
Are a CASE statement and a DECODE equivalent?

It seems like the simple CASE expression and the DECODE function are equivalent and that the results returned by them …

sql oracle case
T-SQL Where Clause Case Statement Optimization (optional parameters to StoredProc)

I've been battling this one for a while now. I have a stored proc that takes in 3 parameters that are …

sql-server tsql query-optimization case where-clause
Why "final static int" can be used as a switch's case constant but not "final static <your enum>"

Why is this int switch valid: public class Foo { private final static int ONE = 1; private final static int TWO = 2; public …

java enums constants case switch-statement
What is the reason for the weird syntax of the "case" statement in a bash/zsh script?

Looking from a programmer's point of view then shell script is just another programming language, where one has to learn …

bash shell case zsh
final variable case in switch statement

final int a = 1; final int b; b = 2; final int x = 0; switch (x) { case a:break; // ok case b:break; // compiler …

java switch-statement case final
uppercase to lowercase in bash on a mac

I'm writing a bash script which needs to convert a string to lowercase. The problem is I'm doing it on …

macos bash case