UNION operator with QueryBuilder

风格不统一 提交于 2020-01-05 12:09:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!