Quote:
Originally Posted by SDB
Hi All
I'm struggling with this.
I want a SQL statement to request :
A list of thread ids (not repeating the same threadid twice)
That userid 888 has - at some point - posted in
and where lastpostuserid <> 888 (ie, someone has posted since)
ordered by lastpost desc
In other words, this will be a list of thread ids, that the user has posted in, that have received a reply since he posted, and in order of newest first.
Thanks in advance
|
[sql]
SELECT DISTINCT p.threadid from
post p JOIN thread t USING (threadid)
WHERE userid=888
AND lastposter != username
order by t.dateline desc
[/sql]
coul dbe p.dateline in the order, depending on your definition of "newest"