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" com
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 |
At 12:01 -0400 10/6/03, Cummings, Shawn (GNAPs) wrote:
This doesn't seem to be making sure that the "newest" commentid is
the result... Seems to be random.
Your requirements are unclear.
If you want output sorted by descending order of commentid, then
your original query should produce that. In
Have you tried:
select commentref,max(commentid)
from comments
group by commentref
Regards,
Joseph Bueno
Cummings, Shawn (GNAPs) wrote:
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 co
For instance;
mysql> select commentid, commentref from comments GROUP BY commentref ORDER
by commentref DESC, commentid;
+---++
| commentid | commentref |
+---++
|80 |188 |
|73 |187 |
|76 |185 |
|56
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) [mailt
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 v