?
Solved

Database sort the sort again

Posted on 2011-10-04
2
Medium Priority
?
238 Views
Last Modified: 2012-06-21
Hi,
i was wondering if i can sort then sort again in a 1 line Mysql query?

eg. if i have TABLEXX

Project Name    Product Name
Project a          product 1
Project b          product 4
Project a          product 8
Project a          product 6
Project b          product 3

I sort first by Project Name so i get the output

Project a          product 1
Project a          product 8
Project a          product 6
Project b          product 3
Project b          product 4

but then i sort by Product so i should get

Project a          product 1
Project a          product 6
Project a          product 8
Project b          product 3
Project b          product 4

Any help would be great.Cheers.
0
Comment
Question by:chiboy888
2 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 200 total points
ID: 36914845
try this

select Project_Name ,    Product_Name from TABLEXX
order by  Project_Name ,    Product_Name
0
 

Author Comment

by:chiboy888
ID: 36940344
thanks pratima,
i think that did the trick
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

840 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