The jOOQ User Manual
© 2009 - 2017 by Data Geekery™ GmbH. Page5/299
4.6.4. The VALUES() table constructor......................................................................................................................................................... 110
4.6.5. Nested SELECTs...................................................................................................................................................................................... 110
4.6.6. The Oracle 11g PIVOT clause.............................................................................................................................................................. 111
4.6.7. jOOQ's relational division syntax........................................................................................................................................................ 112
4.6.8. Array and cursor unnesting................................................................................................................................................................. 112
4.6.9. Table-valued functions.......................................................................................................................................................................... 113
4.6.10. The DUAL table.................................................................................................................................................................................... 113
4.7. Column expressions.................................................................................................................................................................................. 114
4.7.1. Table columns......................................................................................................................................................................................... 115
4.7.2. Aliased columns...................................................................................................................................................................................... 115
4.7.3. Cast expressions..................................................................................................................................................................................... 115
4.7.4. Datatype coercions................................................................................................................................................................................ 116
4.7.5. Arithmetic expressions.......................................................................................................................................................................... 117
4.7.6. String concatenation.............................................................................................................................................................................. 118
4.7.7. General functions................................................................................................................................................................................... 118
4.7.8. Numeric functions.................................................................................................................................................................................. 118
4.7.9. Bitwise functions..................................................................................................................................................................................... 119
4.7.10. String functions..................................................................................................................................................................................... 120
4.7.11. Case sensitivity with strings.............................................................................................................................................................. 121
4.7.12. Date and time functions.................................................................................................................................................................... 121
4.7.13. System functions.................................................................................................................................................................................. 121
4.7.14. Aggregate functions............................................................................................................................................................................. 122
4.7.15. Window functions................................................................................................................................................................................ 123
4.7.16. Grouping functions.............................................................................................................................................................................. 125
4.7.17. User-defined functions....................................................................................................................................................................... 127
4.7.18. User-defined aggregate functions................................................................................................................................................... 127
4.7.19. The CASE expression.......................................................................................................................................................................... 129
4.7.20. Sequences and serials........................................................................................................................................................................ 129
4.7.21. Tuples or row value expressions..................................................................................................................................................... 130
4.8. Conditional expressions........................................................................................................................................................................... 131
4.8.1. Condition building.................................................................................................................................................................................. 132
4.8.2. AND, OR, NOT boolean operators..................................................................................................................................................... 132
4.8.3. Comparison predicate........................................................................................................................................................................... 133
4.8.4. Boolean operator precedence............................................................................................................................................................ 134
4.8.5. Comparison predicate (degree > 1).................................................................................................................................................. 134
4.8.6. Quantified comparison predicate...................................................................................................................................................... 135
4.8.7. NULL predicate....................................................................................................................................................................................... 136
4.8.8. NULL predicate (degree > 1)............................................................................................................................................................... 136
4.8.9. DISTINCT predicate................................................................................................................................................................................ 136
4.8.10. BETWEEN predicate............................................................................................................................................................................. 137
4.8.11. BETWEEN predicate (degree > 1).................................................................................................................................................... 138
4.8.12. LIKE predicate....................................................................................................................................................................................... 138
4.8.13. IN predicate........................................................................................................................................................................................... 139
4.8.14. IN predicate (degree > 1)................................................................................................................................................................... 140
4.8.15. EXISTS predicate................................................................................................................................................................................... 140
4.8.16. OVERLAPS predicate........................................................................................................................................................................... 141
4.8.17. Query By Example (QBE)................................................................................................................................................................... 141
4.9. Dynamic SQL............................................................................................................................................................................................... 142
4.10. Plain SQL.................................................................................................................................................................................................... 143
4.11. Plain SQL Templating Language.......................................................................................................................................................... 145
4.12. SQL Parser................................................................................................................................................................................................ 146
4.12.1. SQL Parser API...................................................................................................................................................................................... 147
4.12.2. SQL Parser Grammar.......................................................................................................................................................................... 148
4.13. Names and identifiers............................................................................................................................................................................ 149