Hi,

Am working new in jooq. will you explain how do i use group_concat. Here i 
have to group_concat one of the selection field.

Mysql query:
SELECT group_concat(AUF.AcLineId )FROM AcHeader as AH INNER JOIN AcDetails 
AS AD ON  AD.AcHeaderId = AH.AcHeaderId INNER JOIN AcUserField AS AUF ON 
AUF.AcLineId = AD.AcLineId AND AUF.FieldNo = 1 WHERE  AH.Company = 1 AND 
AH.AccountNo = 190000 AND AH.Status IN ('C', 'D')  

Jooq Query:

dslContext.select(AUF.AcLineId).from(AcHeader).Join(AcDetails).on(AcDetails.AcHeaderId.equal(AcHeader.AcHeaderId)).Join(AcUserField
 
).on(AcUserField.AcLineId.equal(AcDetails.AcLineId)) 
 .and(AcUserField.FieldNo.equal()).Where(AcHeader.Company=1)   
.and(AcHeader=AccountNo=190000).and(Status.in("'C','D'")).fetch()


http://stackoverflow.com/questions/32138417/how-do-i-write-jooq-select-query-for-the-following-mssql-query

Kindly share your idea..

Regard,
Manikandan

On Sunday, March 18, 2012 at 5:11:44 PM UTC+5:30, TheDude wrote:
>
> Hello, 
>
> I've started playing with jOOQ for a week now, using it as a sql 
> querybuilder to use with spring's jdbcTemplate, and until now the 
> framework is fullfilling my needs ! 
>
> I'm now facing the following concern, which I don't know how to 
> achieve, even since I've read the doc and browsed the api javadoc : 
>
> Let's say I have a countries table : 
> ccode char(2) PK, cname varchar(255) 
>
> I'd like to produce the following resultset : 
> 'fr', 'fr - France' 
>
> The generated select statement (mysql syntax) should be like this : 
> <pre> 
> select `t`.`ccode`, concat(cast(`t`.`ccode` as char), ' - ', 
> cast(`t`.`cname` as char)) as `value_` from `countries` as `t` order 
> by `t`.`country` asc 
> </pre> 
>
> I would like to kow how to programmatically achieve it using the 
> Factory.concat method, or maybe do have I 
> missed something ? 
>
> Thanks in advance and greetings from France! 
>
> TL. 
>

-- 
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.

Reply via email to