Jahia Template Forum > SQL2 JOIN in template

0 (0 Good)
0 (0 Bad)

SQL2 JOIN in template

by  gushil »  2012/10/04 07:01

Hello All,

I made a page to show all news content created by current login user. This is accomplished by using this jcr query in template :

select * from [jnt:news] as news where news.[jcr:createdBy]='${currentUser.name}' order by news.[date] desc

I have a question, how to get all news content created by user who has lastname such as Beckham? Can I join [jnt:news] with [jnt:user]? How?

Thanks

  • SQL2 JOIN in template
    2012/10/04 07:02

    gushil <p> Hello All,</p> <p> I made a page to show all news content created by current login user. This is accomplished by using this jcr query in template :</p> <p> select * from [jnt:news] as news where news.[jcr:createdBy]=&#39;${currentUser.name}&#39; order by news.[date] desc</p> <p> I have a question, how to get all news content created by user who has lastname such as Beckham? Can I join [jnt:news] with [jnt:user]? How?</p> <p> Thanks</p>

  • Number of messages  1
    Registration date Oct 4, 2012
    0 (0 Good)
    0 (0 Bad)

    Re: SQL2 JOIN in template

    by  faissah »  2012/10/12 21:47

    Hello,

    You can use JOIN in SQL2. Have you taken a look at this apache documentation?

    HERE

    Regards,
    Fabrice

    Fabrice  (faissah)

    Number of messages  264
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page