|previous : next|
Available in versions: Dev (3.18)
This is experimental functionality, and as such subject to change. Use at your own risk!
This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
- The constant is
NULL, in case of which the
COUNT(NULL)value is always
0(but that's not an aggregate function, so we're currently not replacing it yet)
- The constant is anything else, in case of which the
COUNT(const)value is always
For clarity reasons, and in some RDBMS also for (slight) performance reasons,
COUNT(*) should be preferred.
Using Settings.transformPatternsCountConstant, the following transformations can be achieved:
-- With Settings.transformPatternsCountConstant active, this: SELECT COUNT(NULL), COUNT(1); -- ... is transformed into the equivalent expression: SELECT COUNT(NULL), -- Might be replaced by 0 in the future, if other aggregates are present COUNT(*);