0
Let’s Say I have 1 table (1) with the users info. A table 2 with users plans. I need to select each users plan and show on the same line in case he’s got more than 1 plan.
TABLE 1:
+------+------+
|ID |NAME |
+------+------+
|1 |A |
+------+------+
|2 |B |
+------+------+
|3 |C |
+------+------+
TABLE 2:
+------+------+
|ID |PLAN |
+------+------+
|1 |ASUS |
+------+------+
|2 |APPLE |
+------+------+
|2 |ASUS |
+------+------+
|2 |ACER |
+------+------+
|3 |ACER |
+------+------+
The result should be:
+------+------+------+------+------+
|ID |NAME |PLAN |PLAN |PLAN |
+------+------+------+------+------+
|1 |A |ASUS |null |null |
+------+------+------+------+------+
|2 |B |APPLE |ASUS |ACER |
+------+------+------+------+------+
|3 |C |ACER |null |null |
+------+------+------+------+------+
Welcome to the Stackoverflow in Portuguese. As the name suggests, the official language used here is Portuguese. So, could you please translate your question? If you prefer, you can also ask the same question on Stackoverflow website in English.
– Sorack