问题
I want to create a SELECT statement, which is a union of two sub-queries.
Is there any way in ORMLite to create the two queries with QueryBuilder, and then concatenate them and create a UNION like this with a third QueryBuilder:
SELECT * FROM (
FIRST SELECT
UNION
SECOND SELECT)
WHERE isdefault = 0 ORDER BY someRow;
someRow also changes dinamically. As for as i know QueryBuilder does not
support UNION directly, so somehow i should inject the concatenated union into
its statement. As the result i want to get a List<MyObject> like QueryBuilder.query() returns it.
来源:https://stackoverflow.com/questions/18099871/union-operator-with-querybuilder