SQL Query Syntax Question

Discussion in 'OT Technology' started by PocketbikePlanet.com, Apr 14, 2005.

  1. I'm trying to pull the last 3 threads from a few forums (vBulletin) and then sort the by the forum's name. Here is what I have so far:

    SELECT t.threadid, t.title, t.firstpostid, t.lastpost, f.title as forumtitle, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, p.pagetext, t.iconid, t.forumid
    FROM thread t
    LEFT JOIN post p ON p.postid = t.firstpostid
    LEFT JOIN forum f ON f.forumid = t.forumid
    WHERE t.forumid
    IN ( 19, 116 )
    AND t.open = '1'
    AND t.visible = '1'
    ORDER BY forumtitle DESC
    LIMIT 0 , 3

    The code above only pull 3 total posts from the forums, any ideas on how to pull the last 3 posts from each forum?

    Thanks in advance!
     
  2. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA

Share This Page