I have run into a 1-N situation. i.e 1 record in 1st table will have multiple records in second table, I just wanna fetch all data corresponding to the ID in 1st table using joins, is this possible.
table 1 : ID name
1 pradeep
table 2: ID table1_id orders
1 1 23
2 1 25
3 1 26
In a single query i should get all records. I don’t wanna loop as i am doing it and its taking lot of time.
I want to display user html output in manner like this. So there lies the problem.
ID Name orders1 orders2 orders order4
I wouldn’t recomment it though. Why don’t you just run it as 2 separate queries?