I want to create a combination of items from different categories ids.
Can you help me?
table
+---------+-------------+------------+
| post_id | category_id | post_title |
+---------+-------------+------------+
| 1 | 1 | Red |
| 2 | 1 | Black |
| 3 | 2 | Medium |
| 4 | 3 | Male |
| 5 | 3 | Female |
+---------+-------------+------------+
The query results I want is as follows:
Red-Medium-Male
Black-Medium-Male
Red-Medium-Female
Black-Medium-Female
For example, if there were items belonging to 6 different categories, it would be like below:
Red-Medium-Male-Other1-Other2-Other3