How do I create a list of forum names, topics and associated replies

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MoreThanWYSIWYG
    New Member
    • Jan 2015
    • 1
    • 3.8.x

    How do I create a list of forum names, topics and associated replies

    So, I am presented with the task of exporting all topics and replies for import into Salesforce Chatter Answers. I'm a novice sql user, and can write selects and inserts and such, but nothing too deep.

    So what I need to do is create a list of all forums, it's associated sub-forums (if any), it's child topics and all of the topic replies.

    Does anyone have a sql statement that can point me in the right direction, or know of another way of getting this data?

    Thanks,
    Joe
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    I don't think there is any simple single query to do that for you.

    Comment

    • Lats
      Senior Member
      • Mar 2002
      • 3671

      #3
      This should be a good start for you...
      Code:
      SELECT
       forum.forumid AS forumid,
       forum.title AS forumtitle,
       thread.threadid AS threadid,
       thread.title AS threadtitle,
       post.postid AS postid,
       post.pagetext AS posttext,
       post.title AS posttitle
      FROM
       forum
      LEFT JOIN
       thread ON thread.forumid = forum.forumid
      LEFT JOIN
       post ON post.threadid = thread.threadid
      ORDER BY
       forum.forumid,
       thread.threadid,
       post.postid
      Lats...

      Comment


      • Zachery
        Zachery commented
        Editing a comment
        You're always coming to the rescue with good queries.
    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...