Solved

Unordered Grouping in Query

Posted on 2000-03-09
3
204 Views
Last Modified: 2008-03-06
How can I make a grouping ordered without making a new PK? Should I use an index? if yes, how?
0
Comment
Question by:ndubow
3 Comments
 
LVL 4

Expert Comment

by:mitek
ID: 2600907
could you please explain what you're trying to do ?
0
 
LVL 4

Accepted Solution

by:
wqw earned 50 total points
ID: 2601023
is this what you are looking for?

select * from (select groupid, max(whatever) as whatever
        from yourtable
        group by groupid) as s
order by s.whatever

orders a grouped resultset

HTH,

</wqw>
0
 
LVL 1

Author Comment

by:ndubow
ID: 2601118
wqw,  BEAUTIFUL!!!!!! That's exactly what I wanted.

Thank you very much.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now