473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

New Group By, order by question

All,

I have a question about grouping numbers.

Lets say I have 10 records each containing a numeric value:-

1
2
3
5
10
-1
-2
-3
-4
-5

What I wish to do is to select the records from the database but group them
like this :-
e.g. by the highest value (ASC or DESC) regarldess of whether the value is
positive or negative?

10
5
-5
-4
3
-3
2
-2
1
-1

Can I do this in one query, or do I need to make two queries

Regards

Marty


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1383

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
1
by: Tamer Higazi | last post by:
Hi! I have problems creating joins between tables and to limit rows for a specified clolumn. I have 2 tables! employees departments I face the problems with the GROUP BY clause and i don't...
2
by: Tom Loach | last post by:
Our system administrator set up an NT server group in order to allow our users to login to our application via https to our sql server. The group appears as a User in SQL Server when you look at...
4
by: Chad Richardson | last post by:
I've always been mistified why you can't use a column alias in the group by clause (i.e. you have to re-iterate the entire expression in the group by clause after having already done it once in the...
0
by: Tom Loach | last post by:
Our system administrator set up an NT server group in order to allow our users to login to our application via https to our sql server. The group appears as a User in SQL Server when you look at...
12
by: Bill Moran | last post by:
Hey all. I've hit an SQL problem that I'm a bit mystified by. I have two different questions regarding this problem: why? and how do I work around it? The following query: SELECT GCP.id,...
4
by: Mike Nolan | last post by:
I'm trying to create a summary log by hour. Here's the query (somewhat simplified): select to_char(mtrantime,'mm-dd hh AM') as datetime, count(*) as tot from memtran group by datetime order...
1
by: Thomas Qi | last post by:
There is a basic sql below: SELECT CTEnr AS ID, TimeStamp, DatagramSize, Source AS LocalIP, Destination AS RemoteIP, Protocol, Messages, SourcePort AS LocalPort, DestPort AS RemotePort FROM...
4
by: pkerr2003 | last post by:
I want to list all groups within my data regardless of whether they meet a certain condition - if they do not meet the condition I want to display a count of 0 for the relevant groups. Access...
3
by: ylekot88 | last post by:
Hi I am a student, I am trying to figure this out. I am trying to run a select statement that is asking for customer#, date, and total price of each order. ensure results are in chronological...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.