I was searching here for answer, but couldn't find right answer to my question. I have tables:
---------- ---------- ----------
| offers | | bids | | users |
---------- ---------- ----------
id id id
.... offer_id first_name
.... user_id last_name
.... .....
Now I need to each offer id assign user last and first name where
offers.id = bids.offers_id and bids.user_id = users.id
Example:
offers bids users
------------------ ---------------------- ----------------
|id| ...| ....| |id| offer_id| user_id| |id| first_name| last_name|
------------------ ----------------------- --------------------------
|1 | ...|.....| |1 | 1 | 2 | | 2| Peter | Jackson |
|2 | ...|.....| |2 | 1 | 3 | | 3| Adam | Black |
|3 | 1 | 6 | | 4| Roy | Wright |
|4 | 2 | 5 | | 5| Eva | Cekovsky |
|5 | 2 | 7 | | 6| Martin | Tyson |
| 7| Vera | Vornel |
And the output should be like this
offer_id full_name
--------------------------------------------------------------
| 1 | Peter Jackson, Adam Black, Martin Tyson |
--------------------------------------------------------------
| 2 | Eva Cekowsky, Vera Vornel |
--------------------------------------------------------------
I can easily connect last with first name using CONCAT
and do it if every data was in same table, but this,I can't figure it out.