Actually, if I go look at your prior post, I guess the problem is just that you forgot to put in the ORIGINAL post for each itemid in this forum thread.
I've added on comment per itemid, to establish an original post. I also shortened your crazy itemid values to 3 characters for readability.
And got rid of your totally useless commentid field (at least I sure can't find any use for it).
SO now I have this:
Code:
mysql> select * from comments order by itemid,dateAdded;
+--------+---------------------+--------+---------------------------------------------+
| itemid | dateAdded | userid | comment |
+--------+---------------------+--------+---------------------------------------------+
| 163 | 2012-12-09 01:00:00 | ABC3EF | originsl comment so owner is emma |
| 163 | 2012-12-09 09:38:52 | SDF5gH | owner emma(ABC3EF) comment by simon(SDF5gH) |
| 383 | 2012-11-10 00:00:00 | ABC3EF | original comment so owner is emma |
| 383 | 2012-11-15 09:47:48 | 100 | owner emma(ABC3EF) comment by jason(100) |
| 383 | 2012-12-08 09:46:41 | 1 | owner emma(ABC3EF) comment by peter(1) |
| 3ef | 2012-01-01 00:00:00 | 100 | original comment so ownere is jason |
| 3ef | 2012-12-09 09:50:26 | ABC4EF | owner jason(100) comment by emma(ABC3EF) |
| 3ef | 2012-12-09 09:59:26 | 1 | owner jason(100) comment by peter(1) |
| 3ef | 2012-12-09 10:00:37 | 100 | owner jason(100) comment by jason(100) |
| 3ef | 2012-12-09 10:20:50 | 100 | owner jason(100) comment by jason(100) |
| 3ef | 2012-12-09 11:00:50 | SDF5gH | owner jason(100) comment by simon(SDF5gH) |
+--------+---------------------+--------+---------------------------------------------+
Will this work?