Forums

How to select DISTINCT(CONCAT(??? in the 'fields to retrieve' section

NickOg 03 Dec, 2018
Hi

I want to use
DISTINCT(CONCAT(mdlPublishedTerms.intYear,mdlPublishedTerms.txtTerm)):mdlPublishedTerms.publishedTerm
in a db read 'Fields to retrieve' section.

Or better still in select only records where CONCAT(mdlPublishedTerms.intYear,mdlPublishedTerms.txtTerm) is distinct

Any suggestions gratefully received.

Regards

Nick
healyhatman 03 Dec, 2018
Answer
Spaces between the elements.

DISTINCT( CONCAT( mdlPublishedTerms.intYear , mdlPublishedTerms.txtTerm)):mdlPublishedTerms.publishedTerm
NickOg 03 Dec, 2018
Ye gods! That easy! Many thanks. My question is - how did you know that? Is there some general rule that I am missing??

Regards

Nick
healyhatman 03 Dec, 2018
from a glance at a forum post a year ago.
NickOg 07 Dec, 2018
Pushing a bit further - how can I set up WHERE to seelct records with the same id as a previous read??
mdlConvenersInfo.id/IN: ( {var:read_data96.mdlConveners})
That mdlConveners looks like this

[array] 0 [array] mdlConveners [string] user_id = "587" [array] 1 [array] mdlConveners [string] user_id = "600" [array] 2 [array] mdlConveners [string] user_id = "605"


    I have a feeling that mdlConveners is wrong for the purpose.

    Regards

    Nick
    healyhatman 07 Dec, 2018
    mdlConvenersInfo.id/IN:{var:read_data96.model.field}
    Should do it
    This topic is locked and no more replies can be posted.