Hi,
I am trying to write an SQL statement to pull some forum data from my database,
I have separated boards, topics and posts. Basically, I am trying to make an sql query that will:
get the most recent post (easy - ORDER BY data LIMIT 1) - Tick :-)
however, this is where I get stuck!
I want to get a the most recent post for a specific board
I have tried to get it with sub Select queries, this is what I have so far:
SELECT post.subject, post.datePosted FROM post WHERE post.postId = (SELECT postId FROM post WHERE
{INSERT SQL VOODOO HERE}
ORDER BY datePosted DESC LIMIT 1);
I could just get rid of the complication and add date updated field to my topic table but this is just another thing that could go wrong when submitting a post - plus I thought doing it this way might be cleaner - am I on the right track or do I need to have a look at joins?
Cheers,
Tom