Hi Atul,
I too has faced certain situations like this.
My suggestion is:
1. Take data using Joins statement.
2. Instatiate a
String as nameStr, and two ArrayList objects as phonesList & carsList.
3. Now as you get data from the query, for the first row of the resultset:
3.a) Set value of "Name" column to nameStr.
3.b) Set value of "phone" column to phonesList
3.c) Set value of "car" column to carsList.
4. For subsequent rows from the resultset:
4.a) If value for "phone" column is already present in phonesList, ignore. Else, add it to the list.
4.b) If value for "car" column is already present in carsList, ignore. Else, add it to the list.
5. After the entire resultset is processed, you will get name, phonesList, carsList.