Left Join and concatenate two columns
Left Join and concatenate two columns
peterbrowne
Posts: 314Questions: 54Answers: 0
Using the following left join I want to concatenate two columns from the table 'unit':
Field::inst( 'learning_event.unit_fk' )
->options( Options::inst()
->table( 'unit' )
->value( 'unit_pk' )
->label( 'unit_name' )
),
Field::inst( 'unit.unit_name' )
->leftJoin( 'unit', 'unit.unit_pk', '=', 'learning_event.unit_fk' )
So that columns 'unit_name' and 'unit_code' are joined with a space. How can I do that?
This question has an accepted answers - jump to answer
Answers
Do you mean for the label shown in the
Options
list? Unfortunately it doesn't yet support a left join operation. It could be done with a VIEW though. Create the view which does the left join and then point the->table()
at that.Allan