FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » rdf help
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: rdf help [message #17790 is a reply to message #17444] Mon, 19 April 2004 00:50 Go to previous messageGo to previous message
mocara is currently offline  mocara   United Kingdom
Messages: 157
Registered: January 2004
Karma:
Senior Member
Quote:

SELECT
distinct m.thread_id, m.id, m.poster_id, m.reply_to, m.ip_addr, m.host_name, m.post_stamp, m.update_stamp, m.updated_by, m.icon, m.subject, m.attach_cnt, m.poll_id, m.foff, m.length,m.file_id, m.offset_preview, m.length_preview, m.file_id_preview, m.attach_cache, m.poll_cache, m.mlist_msg_id, m.msg_opt, m.apr,
u.alias,
t.forum_id,
p.name AS poll_name, p.total_votes,
m2.subject AS th_subject,
m3.subject AS reply_subject,
f.name AS frm_name,
c.name AS cat_name
FROM
fud26_msg m
INNER JOIN fud26_thread t ON m.thread_id=t.id
INNER JOIN fud26_forum f ON t.forum_id=f.id
INNER JOIN fud26_cat c ON c.id=f.cat_id
INNER JOIN fud26_msg m2 ON t.root_msg_id=m2.id
LEFT JOIN fud26_msg m3 ON m3.id=m.reply_to
LEFT JOIN fud26_users u ON m.poster_id=u.id
LEFT JOIN fud26_poll p ON m.poll_id=p.id
INNER JOIN fud26_group_cache g1 ON g1.user_id=0 AND g1.resource_id=f.id
WHERE
t.moved_to=0 AND m.apr=1 AND (g1.group_cache_opt & 2) > 0 GROUP BY m.thread_id ORDER BY m.post_stamp DESC LIMIT 20;


Just looking for ideas. I can see one flaw here. This will give me distinct thread but the first post in each thread and not the latest. distinct m.thread_id and group by m.thread_id being the basic changes.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stuck in a Circle
Next Topic: Global settings are ignored - please advice
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 12 21:09:13 GMT 2024

Total time taken to generate the page: 0.04674 seconds