Adds abilty to create a SubQuery without starting with a table. For example:
var sql=require("sql")
var subQuery = sql.subQuery().select(user.id).from(user)
var query=post.select().where(post.user_id.in(subQuery))
In this example, the subQuery could have been defined as user.subQuery().select(), but there are instances when dynamically generating SQL where you may not have the table at the time you want to create the subquery.
Adds abilty to create a SubQuery without starting with a table. For example:
In this example, the
subQuery
could have been defined asuser.subQuery().select()
, but there are instances when dynamically generating SQL where you may not have the table at the time you want to create the subquery.