Solved

Unordered Grouping in Query

Posted on 2000-03-09
3
206 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

839 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