Monthly Archives: November 2009

Find user’s most recent post in each thread

One common problem that my sequence method can help to solve is how to display the most recent entry that a user has made in each thread that the user has contributed to: SELECT * FROM posts WHERE usedid = $userid AND postid IN (SELECT t1.postid, COUNT(t1.postid) AS sequence, t1.postid <= t2.postid AS flg FROM [...]
Posted in SQL Tips n Tricks | Tagged , , , , | 1 Comment