I want to generate a thread-like view
In the table I have from,to,date and some other columns
I want to output the rows grouped by from AND to
example data in DB
from,to,date
a,b,somedate
a,c,somedate
b,a,somedate
Query:
SELECT
from, to, date
FROM
data
GROUP BY
from, to
ORDER BY
date DESC;
The output I expect is like this: (where from and to is grouped together)
a,b,somedate
a,c,somedate
(b,a,somedate not shows because its in the a,b group)
but it doesn't ..
The general idea is to have a Messaging View "by user" .. where the list is sorted by recipients,date (not by message) ...
a,bandb,a?fromandtocollum to handled as one for the grouping .. (somethings like that)