Skip to content
Advertisement

SQL: Query the same column 3 times with 3 different where clauses

Trying to show a table with 3 columns that are prices that need to be displayed. the columns are differentiated by ‘price_type’ and there are 3 different price types.

Its probably something obvious im missing but something like:

I’m not sure what the actual syntax would be, but any help is appreciated.

Advertisement

Answer

With conditional aggregation:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement