SELECT a.author 作者, a. SUBJECT 主题, FROM_UNIXTIME( a.dateline, '%Y-%m-%d %H:%i' ) 发布时间 FROM pre_forum_thread a WHERE NOT EXISTS ( SELECT * FROM pre_forum_thread_moderate b WHERE a.tid = b.id ) AND a.displayorder = '-2'
复制代码
每次用此语句进行修复主题状态:
INSERT INTO pre_forum_thread_moderate (id, dateline) SELECT tid,dateline FROM pre_forum_thread WHERE NOT EXISTS (SELECT * FROM pre_forum_thread_moderate WHERE pre_forum_thread_moderate.id = pre_forum_thread.tid ) AND displayorder = '-2'