Having this private chat table
On my message page I want to show latest conversations list. List will be like if am sending message from pc to pc2 and pc2 sending back to pc then it should show only one row.
I tried this query
SELECT id, col2, col3, col4 FROM yourtable GROUP BY col2, col3;
Selecting distinct 2 columns combination in mysql
But it's resulting in
Update:
I tried this query
SELECT * FROM tbl_primessages Where frmid = 3466 OR toid = 3466
GROUP BY frmid, toid ORDER BY tbl_primessages
.timestemp
DESC
Update 2 It should be with the latest time from two