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
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
:[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
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
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
: 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
At 12:09 -0400 10/6/03, Cummings, Shawn (GNAPs) wrote:
For instance;
mysql select commentid, commentref from comments GROUP BY
commentref ORDER by commentref DESC, commentid;
+---++
| commentid | commentref |
+---++
|80 |188 |
|73 |
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