SELECT t.*,a.* FROM cdb_threads t INNER JOIN cdb_attachments a ON t.tid=a.tid WHERE t.attachment=1 and a.isimage=1 group by t.tid ORDER BY t.dateline DESC
(注意:把cdb_改成论坛数据表的前缀,默认为cdb_)
2、调用论坛指定版块多图帖子中的其中一张图片
SELECT t.*,a.* FROM cdb_threads t INNER JOIN cdb_attachments a ON t.tid=a.tid WHERE t.fid in (2) and t.attachment=1 and a.isimage=1 group by t.tid ORDER BY t.dateline DESC
原帖由 wen110 于 2008-6-1 10:46 发表
SO COOL.谢谢。
在一个问题:如果要指定某个精华,如:digest/3 那这个,可以加在语句中接上么?
直在写在sql语句上吧
例如:
SELECT t.*,a.* FROM cdb_threads t INNER JOIN cdb_attachments a ON t.tid=a.tid WHERE t.attachment=1 and t.digest=3 and a.isimage=1 group by t.tid ORDER BY t.dateline DESC
直在写在sql语句上吧
例如:
SELECT t.*,a.* FROM cdb_threads t INNER JOIN cdb_attachments a ON t.tid=a.tid WHERE t.attachment=1 and t.digest=3 and a.isimage=1 group by t.tid ORDER BY t.dateline D ...