View Single Post
Old 05-21-2006, 01:47 PM   #3 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 701
DJMaze is on a distinguished road
SELECT c.*, u.user_dname, r.user_dname AS replyto_user_dname
FROM comments AS c, user AS u, user AS r
WHERE c.blog_id = bid, c.user_id = u.user_id, c.replyto_user_id = r.user_id

The query itself is pretty big since it needs to search in the user table twice.
DJMaze is offline   Reply With Quote