I have a scenario where I'd like to get columns with information stored in a very specific way. I'd like to select n number of columns from a table A, concatinate their values, and then add m number of more values which should be grabbed from other tables by joining one of their columns to the current statement's column.
- Cars - (car_id, model_id, plate_id, brand_name, year_of_release, custom_column)
- Model - (model_id, model_name, description)
- Plates - (plate_id, car_owner_name, registration_state)
Let's say we have these tables and what we want to do is place the following information in one column:
'car_id, brand_name, year_of_release, plate_id, model_name, car_owner_name, registration_state'
for each row of the Cars table as a 'custom_column' value
I'd like it to be a comma-separated string. Is there a way to do this with MySQL?