Jump to content


Join fields from different tables within one field

join fields tables field relation table enterprise

  • Please log in to reply
No replies to this topic

#1 Manuel

Manuel

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 26 November 2020 - 09:29 AM

Hi, I'm new to GC and I've had a problem that I can't solve.
 
In my database I have three tables:
positions (id, name),
employees (id, name)
employee_positions (position_id, employee_id, start_date, end_date)
 
What code do I have to use to get the following result in my final GC table?
 
Employees table: id (789654123Z), name (Manuel), positions (director '2012-2015', secretary '2016-2020')
 
I have done something similar with setRelationNtoN but joining the fields of the same table:
$ crud-> setRelationNtoN ('actors', 'film_actor', 'actor', 'film_id', 'actor_id', '{reference_id} - {first_name} {last_name}');
 
Thank you all!
 
Manuel.

 







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users