Package org.jooq

Interface Select<R extends Record>

    • Method Detail

      • union

        @Support
        Select<R> union​(Select<? extends R> select)
        Apply the UNION set operation.
        Throws:
        java.lang.IllegalArgumentException - If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
      • unionAll

        @Support
        Select<R> unionAll​(Select<? extends R> select)
        Apply the UNION ALL set operation.
        Throws:
        java.lang.IllegalArgumentException - If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
      • exceptAll

        @Support({AURORA_POSTGRES,CUBRID,DB2,DERBY,HSQLDB,POSTGRES,TERADATA})
        Select<R> exceptAll​(Select<? extends R> select)
        Apply the EXCEPT ALL set operation.
        Throws:
        java.lang.IllegalArgumentException - If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
      • intersectAll

        @Support({AURORA_POSTGRES,CUBRID,DB2,DERBY,HSQLDB,POSTGRES,TERADATA})
        Select<R> intersectAll​(Select<? extends R> select)
        Apply the INTERSECT ALL set operation.
        Throws:
        java.lang.IllegalArgumentException - If the argument select has the same identity as this select. The jOOQ 3.x API is mutable, which means that calls to the DSL API mutate this instance. Adding this instance as an set operation argument would lead to a StackOverflowError when generating the SQL.
      • getSelect

        java.util.List<Field<?>> getSelect()
        All fields selected in this query
      • fetchCount

        @Deprecated
        int fetchCount()
                throws DataAccessException
        Deprecated.
        - 3.5.0 - [#3356] - This method is being removed as it is confusingly different from all the other types of ResultQuery.fetch() methods, in that it modifies the original Select statement by wrapping it. In particular, this method can be easily confused with ResultQuery.fetch(Field), or more concretely fetch(count()), which has an entirely different semantics. Use DSLContext.fetchCount(Select) instead.
        Execute this query in the context of its attached executor and return a COUNT(*) value.

        This wraps a pre-existing SELECT query in another one to calculate the COUNT(*) value, without modifying the original SELECT. An example:

         -- Original query:
         SELECT id, title FROM book WHERE title LIKE '%a%'
        
         -- Wrapped query:
         SELECT count(*) FROM (
           SELECT id, title FROM book WHERE title LIKE '%a%'
         )
         
        This is particularly useful for those databases that do not support the COUNT(*) OVER() window function to calculate total results in paged queries.
        Returns:
        The COUNT(*) result
        Throws:
        DataAccessException - if something went wrong executing the query