I have the following table as an example.
id uid car
1 3 BMW
2 3 AUDI
3 3 JEEP
4 5 MERC
5 6 BMW
6 6 FIAT
Now, I would like to get all cars but for only 2 users but don’t know how many cars they have. When they all would have had only one car, I could just do a LIMIT 3 but how can I do this to get all the cars, but only for 2 users?
EDIT
If the 2 users are unknown you can use MySQL GROUP_CONCAT
Note: Don’t forget to change the tablename in the SELECT query