In article <beqlfq$7to5m$1ID-30799.news.uni-berlin.de>, Agelmar wrote:Right, thing is, on a forum search you don't want to see the same topic a> This should produce an output of something like
> Topic ID | Message ID
> 1 |1
> 1 |2
> 1 |3
> 2 |7
> 2 |13
> 3 |4
> 3 |5
I want unique topic id's, which goes against my query.
The (group by topics.tid) part seemed to reduce this, but I'm not getting
unique (distinct) tid's.
Yeah.> unless of course you only care if *some* message in a given thread matches,
> and you just want the first message in the thread that matches and don't
> care about the rest...
Thanks, this actually solved it, where above I have duplicate tid's even> in this case, you can just do something like:
> $query="select topics.tid, MIN(f_messages.messid) from f_messages left join
> topics on f_messages.tid = topics.tid GROUP BY topics.tid where
> ($title_list) OR ($msg_list)";
> I hope this helps, I must admit I am not totally sure that I understand your
> question, but I gave it my best and I hope this is what you're looking for.
after your addition this is due to proper db duplications which shouldn't
On a side note I had to put the GROUP BY at the end of the query to get it
SDF Public Access UNIX System - [url]http://sdf.lonestar.org[/url]