I have three tables as shown below.
How to get comma separated output from joining these three table? Desired output is also shown here. By searching I found joining of two tables only.
Table1
staff_id vehicle_id
---------------------
1 22
1 33
1 44
2 55
Table2
vehicle_id vehicle_type_id
----------------------------
22 1000
33 1000
44 3000
55 2000
65 2000
75 2000
Table3
vehicle_type_id vehicle_type_name
----------------------------------
1000 AA
2000 BB
3000 CC
4000 DD
Desired output:
staff_id vehicle_type_name
----------------------------
1 AA,AA,CC
2 BB