Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Ordering in a GROUP BY clause

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-24 : 16:53:59
Biren Jhaveri writes "How do i go bout ordering groups and the elements within a group differently?

for e.g.
for a Message Board that allows deep-level threading.
I need to group all posts by their Ancestor Thread.. right?
( as in all posts related to one discussion should appear at one point )

But i want to see new posts on top.
So i need to Group by the Ancestor ID and order the elements IN the group in ascending order of their timestamps... but the groups amongst themselves should be sorted in descending order of their timestamps.

Help!


"
   

- Advertisement -