Announcement

Collapse
No announcement yet.

how can I delete them all by a specific date

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I'm basically stumped then. All I can suggest trying it taking this query:

    Code:
    SELECT MIN(post.postid) AS minpost, MAX(post.postid) AS maxpost, thread.threadid, MAX(post.dateline) AS dateline, 
    (COUNT(*)-1) AS posts, 
    SUM(attachment.visible) AS attachsum 
    FROM post,thread 
    LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid 
    WHERE thread.threadid=post.threadid 
    AND thread.threadid>=400 
    AND thread.threadid<2000 
    GROUP BY thread.threadid 
    ORDER BY threadid DESC;
    And adjusting the red part up specific increments until it doesn't happen (assuming it will stop).

    Comment


    • #17
      Hello,

      I'm sorry , it did not work:

      MySQL said: Can't find record in 'post'

      counters still cannot be updated.

      Comment


      • #18
        Even when you adjusted the part I mentioned up to, say, 1999?

        Comment


        • #19
          It worked when using 1999:
          minpost maxpost threadid dateline posts attachsum
          9143 10162 1999 981136327 4 0

          It worked with the number 1900 as well.
          But now what should I do?what could this help with?
          Last edited by na9; Sun 12 Aug '01, 12:32pm.

          Comment


          • #20
            I'd keep changing that number until you get the number of the thread that is causing the problem. Then we can just delete that thread.

            Comment


            • #21
              How can I know the thread that is causing the problem,there is hundreds of threads that I get when I use the query?

              Comment


              • #22
                Trial and error is about the only way.

                SELECT MIN(post.postid) AS minpost, MAX(post.postid) AS maxpost, thread.threadid, MAX(post.dateline) AS dateline,
                (COUNT(*)-1) AS posts,
                SUM(attachment.visible) AS attachsum
                FROM post,thread
                LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
                WHERE thread.threadid=post.threadid
                AND thread.threadid>=400
                AND thread.threadid<2000
                GROUP BY thread.threadid
                ORDER BY threadid DESC;
                Change the red number to, say, 1000. If you *don't* get the error, you can change the blue part to 1000, then set the red to 900 and rerun the query. Still no error? Set the blue to 900, and the red to 800. Repeat until you get the error.

                When you get the error, you should be able to close in your band of results until, you find the exact thread that's causing the problem (assuming there's only one). That is, the red number would be (for example) 456, and the blue would be 457 (the blue has to be greater than the red!). Then, 456 would be the troublesome thread, and we have to remove it.

                Although I do think this is some sort of MySQL bug. (Or is it a "feature"?)

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X