Sveiki, ir divas tabulas
posts:
id, title, time
1, nosaukums 1, 12345
2, nosaukums 2, 12346
3, nosaukums 3, 12347
4, nosaukums 4, 12348
comments:
id, post_id, comment, time
1, 2, comment 1, 12348
2, 2, comment 2, 12350
3, 3, comment 3, 12352
4, 1, comment 4, 12353
5, 3, comment 5, 12354
Kā man jānorādas mysql, lai rādītu rezultāti no posts, bet rādītu by time no abām tabulām, ja tipa postam ir jauns komentārs viņš viņu rāda kā pēdējo, kaut arī ir jaunāki posti.
"SELECT p.id,p.title,p.time FROM posts AS p LEFT JOIN comments AS c ON c.post_id = p.id GROUP BY p.id ORDER BY p.time DESC"
"ORDER BY p.time DESC" šajā vietā jāiemet kautkā ja (c.time > p.time ? c.time : p.time)
Ceru, ka sapratāt domu