Top "Case-when" questions

Use this tag only for SQL queries with case expressions.

correct way to create a pivot table in postgresql using CASE WHEN

I am trying to create a pivot table type view in postgresql and am nearly there! Here is the basic …

sql postgresql pivot pivot-table case-when
Creation of view with case when statement

Please refer to my example below for clearer understanding of what i'm doing. Example: Create View v AS Select T.*, …

sql oracle select case-when create-view
Oracle SQL - CASE syntax

Assume this query which functions fine: SELECT first_name, consultant_id, CASE consultant_id WHEN 1 THEN 'First Consultant' WHEN 2 THEN …

sql oracle case-when booleanquery
MySQL replace result value with another value

I have MySQL and the query is: select name,re_type from myTable I want to replace all values of …

mysql sql case-when ansi-sql
SQL Server using CASE WHEN THEN statement

I have a sample query like this: select t1.name,t1.bday,t2.address,t2.contactnum from table1 as t1 …

sql sql-server case-when
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
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