I have two tables related to user information: Table 1(Users) contains columns like id,username and email Table 2(details) contains columns like user_id,degree_name and degree when I am joining these two tables, result I am getting is:
name degree_name degree
john doe Metric Science
john doe Fsc Engineering
john doe Bsc BSCS
herald Metric Science
Matt Metric Science
In above records "john doe" is repeating 3 times. what should be not expected result. The result I want here is and also I know can be achievable by using find_in_set() is:
0: {name: john doe
details: {0: {degree: "Science",degree_name: "Metric"}
1: {degree: "Fsc",degree_name: "Engineering "}
2: {degree: "Science",degree_name: "BSCS"}}}
1: {name: herald
details: {0: {degree: "Science",degree_name: "Metric"}}}
2: {name: Matt
details: {0: {degree: "Science",degree_name: "Metric"}}}
Is there anybody who guide me for the right query?