I really appreciate your reply:
My table looks like this:
| id | food_name | food_qty | 1 Chicken 3
2 Egg 1
So basically, 1 id has multiple lines on it
I tried this:
SELECT replace(replace(food_name, char(13), ' '), char(10), ' '), replace(replace(food_qty, char(13), ' '), char(10), ' '), CONCAT(food_name,' ',food_qty) as food_name_qty FROM foodx
The reason I tried to replace the line feed because i was hoping that the concat would replace the new line and the values will be side by side but it's not.
I also tried this:
SELECT CONCAT_WS(' ',COALESCE(food_name,''),COALESCE(food_qty,'')) AS food_name_qty FROM foodx
It doesn't work, also.
I just want the output to display side by side.
Chicken - 3 ( the food name has the quantity on the same row)
Hotdog - 4
Thanks, I really need your help.
if this would not be possible, maybe i would just create a separate table with the pre-formatted string so i will I would have any problem for retrieval of data when it's exported to CSV.