Hi there,
is there any way to create a "SELECT DISTINCT ON (a) a, b FROM (...)
ORDER BY (a)" from PostgreSQL? I recognized "selectDistinct", but
don't want all fields to be distinct, only one. Or does
"selectDistinct(...).select(...)" do the job? Didn't seem to work, but
I maybe have some unrelated problems elsewhere.
So is "DISTINCT ON" possible at all using jOOQ or not and if yes, how?
Postgres is the only RDBMS I need to support currently, so it's
perfectly fine if it only works with that. The only thing coming into
my mind would be to create the statement using jOOQ, afterwards use
toString to get a plain SQL string, insert "DISTINCT ON" where needed
and use execute(String) afterwards. But I would prefer native jOOQ
methods of course, especially because it's only such small difference
I need over the current "selectDistinct"...
Thanks for your help!
http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-DISTINCT
Mit freundlichen Grüßen,
Thorsten Schöning
--
Thorsten Schöning E-Mail:Thorsten....@AM-SoFT.de
AM-SoFT IT-Systeme
http://www.AM-SoFT.de/
Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow