I am using durpal 6. while retrieving data i got the following output:
| nid | fid |
------------
| 10 | 49 |
| 10 | 57 |
| 10 | 76 |
| 14 | 34 |
| 14 | 45 |
| 14 | 95 |
| 18 | 57 |
| 18 | 65 |
| 18 | 75 |
| 19 | 56 |
| 19 | 45 |
| 19 | 75 |
Now i want to refine the above output like this
| nid | fid1 | fid2 | fid3 |
----------------------------
10 | 49 | 57 | 76 |
14 | 34 | 45 | 95 |
18 | 57 | 65 | 75 |
19 | 56 | 45 | 75 |
Please suggest sql query for that..
You should better explain what you are trying to do. You can use GROUP_CONCAT() to return the fids as a comma separated list.