AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
7.01k stars 653 forks source link

IIF true THEN ['yes'] #607

Closed MarioVanDenEijnde closed 8 years ago

MarioVanDenEijnde commented 8 years ago

Hello ALASQL team,

I have got:

[{"Title":"Belt","MailKeuringenAlert":true}]

and I need for result:

[{"Title":"Belt","MailKeuringenAlert":["yes"]}]

Kind regards, Mario

agershun commented 8 years ago

Hi Mario, Try this:

SELECT Title, IIF(MailKeuringenAlert,@["yes"], NULL) AS MailKeuringenAlert FROM ?
MarioVanDenEijnde commented 8 years ago

Bingo. Thanks.