Skip to content

Subqueries

Andrey Gershun edited this page Apr 14, 2015 · 1 revision

Subqueries

You can use SELECT operator as a part of SQL expressions, like:

    var res = alasql('SELECT * FROM phases q WHERE (SELECT COUNT(*) \
        FROM phases t WHERE t.Phase = q.Phase) = 2');

AlaSQL converts array to single value (like VALUE modifier does) before usage in expression.

See working example in jsFiddle

Clone this wiki locally