Way to select t1.*, t2.col1, t2.col2 from ...

18 views
Skip to first unread message

Rob Nikander

unread,
Sep 25, 2013, 10:58:01 PM9/25/13
to jooq...@googlegroups.com
Hi,

Is this possible? Something like select(TABLE1, TABLE2.COL1).from(TABLE1).join(TABLE2). I've got a big join and I don't want every column in 5 tables coming back. But I don't want to explicity list out 20 columns either.

thanks,
Rob

Lukas Eder

unread,
Sep 27, 2013, 5:16:25 AM9/27/13
to jooq...@googlegroups.com
Hello,

Yes, you can repeat the "SELECT" keyword as such:

 select(TABLE1.fields())
.select(TABLE2.COL1)
.from(TABLE1)
.join(TABLE2)...

Some more examples can be seen in this Stack Overflow question:

Cheers
Lukas

2013/9/26 Rob Nikander <rob.ni...@gmail.com>

--
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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Rob Nikander

unread,
Sep 27, 2013, 8:07:43 AM9/27/13
to jooq...@googlegroups.com
Sweet, thanks!
Reply all
Reply to author
Forward
0 new messages