Solved

Unordered Grouping in Query

Posted on 2000-03-09
3
203 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
Comment Utility
could you please explain what you're trying to do ?
0
 
LVL 4

Accepted Solution

by:
wqw earned 50 total points
Comment Utility
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
Comment Utility
wqw,  BEAUTIFUL!!!!!! That's exactly what I wanted.

Thank you very much.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

771 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

12 Experts available now in Live!

Get 1:1 Help Now