QB: SELECT in the FROM clause possible?
Posted: Fri Mar 29, 2019 5:15 pm
I like to convert following SQL statement to Query Builder (simplified):
SELECT t.column1, t.column2 FROM (SELECT t.column1, column2 FROM table t INNER JOIN ... WHERE ...)
Tried something like the following but can't get access to what's after the FROM clause, i. e. datasources.db.hades.courses.createSelect() already implies the table (courses in this example)
Is there a way to write such a QB statement?
Regards,
SELECT t.column1, t.column2 FROM (SELECT t.column1, column2 FROM table t INNER JOIN ... WHERE ...)
Tried something like the following but can't get access to what's after the FROM clause, i. e. datasources.db.hades.courses.createSelect() already implies the table (courses in this example)
- Code: Select all
query = datasources.db.hades.courses.createSelect(subquery);
c = query.columns;
var subquery = datasources.db.hades.profile_positions.createSelect('pp');
var pp = subquery.columns;
query.result.addSubSelect(subquery);
Is there a way to write such a QB statement?
Regards,