Open lukaseder opened 10 years ago
Just out of interest, I have a utility function that I make extensive use of that takes two Select<?> objects, and constructs a call to crosstab. It's fit for my purposes, but I'm sure that it could be generalised.
If it's of any use to you, I can give it to you.
Thank you very much for your offer. It would certainly be very interesting to learn from it - and possibly to merge it into the jOOQ codebase. I'm mostly curious how you implemented the rendering of the SQL statement within a string. Did you just inline the SQL and escaped apostrophes?
On 25 Aug 2015, at 4:24 pm, Lukas Eder notifications@github.com wrote:
Thank you very much for your offer. It would certainly be very interesting to learn from it - and possibly to merge it into the jOOQ codebase. I'm mostly curious how you implemented the rendering of the SQL statement within a string. Did you just inline the SQL and escaped apostrophes?
That’s exactly what I did.
How would you like the code. Is email O.K?
Cheers, Joe
Perfect. Any way would be fine. I think that other users might be interested too, though. So perhaps the user group would be a good place to show the code...? https://groups.google.com/d/forum/jooq-user
For future reference, an example was posted here: https://groups.google.com/d/msg/jooq-user/e5F7vWrnLdY/iqMzRIsGFQAJ
PostgreSQL has a special set of functions to produce PIVOT tables. These functions are called
crosstab()
and similar, as can be seen here: http://www.postgresql.org/docs/9.3/static/tablefunc.htmlIt would be interesting to support those functions as well in jOOQ, specifically because jOOQ already supports derived column lists for aliasing such pivot tables.
See also: https://groups.google.com/forum/#!topic/jooq-user/e5F7vWrnLdY