我调用带图片的主题贴子,用sql语句结果调出了所有图片,比如,一个主题带有3张图片附件,那么,这个主题会在列表里出现三遍,下面是我问别人的调用语句,改哪里可以实现一个不重复的调用十个不同的带图片附件的贴子呢?- "select cdb_threads.tid,cdb_attachments.attachment,cdb_threads.subject from cdb_threads,cdb_attachments where cdb_threads.tid in (select distinct cdb_threads.tid from cdb_threads,cdb_attachments where cdb_attachments.isimage=1 and cdb_attachments.tid=cdb_threads.tid order by cdb_threads.tid desc) and cdb_attachments.tid=cdb_threads.tid order by cdb_threads.tid desc limit 0,10"
复制代码 |