Thanks a lot Lukas. Yeah, I saw that works too, and prefer it over what I wrote in my last message.
On Thursday, October 27, 2016 at 2:05:47 PM UTC-4, Lukas Eder wrote: > > Hi Jacob, > > Yes, that's one option. Another one is to pass the exact same reference to > ResultQuery.fetchOne() or to Record.get(). e.g. > > Field<?> max = DSL.max(...); > Object value = > DSL.using(configuration) > .select(max) > .from(...) > .fetchOne(max); > > > You could even repeat the entire field expression, although that might be > a bit tedious in your case: > > > Object value = > DSL.using(configuration) > .select(DSL.max(...)) > .from(...) > .fetchOne(DSL.max(...)); > > > Hope this helps, > Lukas > > 2016-10-27 18:14 GMT+02:00 Jacob G <[email protected] <javascript:>>: > >> Never mind. I figured out the issue. DSL.max works fine, but I need to >> give the field a name (i.e.,g DSL.max(...).as("myfield"), and then >> reference that name in the fetchOne("myfield", String.class) call. >> >> >> On Thursday, October 27, 2016 at 11:54:57 AM UTC-4, Jacob G wrote: >>> >>> I'm trying to write a select query using DSL.max on a custom field, >>> i.e., a DSL.field constructed using jsonb, but I'm getting this error when >>> running the following query (specific names obscured): >>> >>> Field (cast("schema"."table"."field" #>> '{property}' AS >>> schema.enum_type)) is not contained in Row >>> (max(cast("schema"."table"."field" #>> '{property}' AS schema.enum_type))) >>> >>> It looks like DSL.max requires that the field be a real column in the >>> table, i.e., in the Record definition. Am I understand that correctly? Is >>> there a way to do what I'm trying? >>> >>> Thanks! >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "jOOQ User Group" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
