tastott / jsoql

A SQL-like language for querying JSON data
http://tastott.github.io/jsoql
3 stars 1 forks source link

CASE statement #88

Closed tastott closed 9 years ago

tastott commented 9 years ago

Not sure this is consistently implemented on the major platforms. I'm going to go with:

CASE Fruit
    WHEN 'Banana' THEN 'Yellow'
    WHEN 'Raspberry' THEN 'Red'
    ELSE '?'
END AS Colour

and

CASE
    WHEN Score < 10 THEN 'You suck!'
    WHEN Score < 50 THEN 'Need more practice'
    WHEN Score < 90 THEN 'Not bad'
    ELSE 'You need to get out more!'
END AS ScoreComment