PDA

View Full Version : MySql query help


Derek_Trotter
12-08-2008, 07:51 AM
Hi,
How can I modify this query:

SELECT thread.title, post.username, post.threadid, post.postid, TIME_FORMAT(time(from_unixtime(post.dateline )), '%H:%i')AS PostTime from post left join thread on post.threadid =thread.threadid order by post.postid desc limit 5

I want to extract last 5 posts, from deferent threads.
(Something like on New Posts search)

Thanks

punchbowl
12-08-2008, 08:07 AM
what's wrong with it? I ran it and got what looks like the last 5 posts on my board?

Derek_Trotter
12-08-2008, 08:08 AM
Ups, I didn't check tread table. I think I can find solution.
Sorry for stupid question:D

--------------- Added 1228731093 at 1228731093 ---------------

what's wrong with it? I ran it and got what looks like the last 5 posts on my board?


I wanted 5 post to be with distinct threads titles. Don't need thread titles to be repeated.