Pages
Categories
Old Posts
- February 2010 (1)
- December 2009 (4)
- November 2009 (1)
- October 2009 (1)
Tag Archives: self-join
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 posts t1 INNER [...]
How to Sequence each Sub-set of Records
How to find/display/keep/delete the first/last n posts/records/entries for each user by using a sequence.
Calculate the Running Balance