I think you want just "ORDER BY commentid DESC" .The previous answer orders by commentref first, which is not what I think you want. Maybe you want "ORDER BY commentid, commentref DESC"
---------------------------------------------------- This doesn't seem to be making sure that the "newest" commentid is the result... Seems to be random. At 09:11 AM 10/6/2003 -0400, you wrote: >try > > select commentid, commentref >from comments > ORDER by > commentref ,commentid DESC; > > > -----Original Message----- > > From: Cummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] > > Sent: Thursday, October 02, 2003 2:37 PM > > To: [EMAIL PROTECTED] > > Subject: sorting/grouping > > > > > > > > > > I have a very simple table. > > > > commentid, commentref (each field is an INT) > > > > Each record is a comment... commentid is the ID (each new record is a > > higher #).. and the commentref field if the "story" the > > comment refers to. > > > > I want to be able to list the stories in order from "most > > recent comment" > > onward. > > > > I've tried > > > > select commentid, commentref from comments GROUP BY > > commentref ORDER by > > commentid DESC; > > > > However, the results are NOT showing me the stories in order > > from most > > active comments onward... Maybe too much soda and sugar - > > but any thoughts? > > > > > > > > > > -- > > MySQL General Mailing List > > For list archives: http://lists.mysql.com/mysql > > To unsubscribe: > > http://lists.mysql.com/[EMAIL PROTECTED] > > > > > >-- >MySQL General Mailing List >For list archives: http://lists.mysql.com/mysql >To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] Shawn Cummings Engineering Project Manager Global NAPs 10 Merrymount Rd Quincy, MA 02169 Desk 617-507-5150 VoIP 617-507-3550 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]