473,699 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sort, Limit then Sort

Hi, I am trying to do a query like:

(SELECT * FROM table1 ORDER BY frequency DESC LIMIT 50)
ORDER BY name;

Where the top 50 frequency values are then sorted by name. When I try
this, it displays each equal frequency value sub sorted by name (so all
freq = 50 are shown a-z, then all freq=40 shpwn a-z etc), rather than
showing the top 50 frequencies sorted by name which is what I want to
achieve.

Many thanks

Aug 11 '05 #1
0 1193

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

Similar topics

22
3414
by: Max M | last post by:
There is a story today on Slashdot Open Source Project Management Lessons ====================================== http://developers.slashdot.org/article.pl?sid=03/07/02/1817220&mode=flat&tid=185 "Paul Baranowski takes a moment to reflect on Open Source Project Management in his blog. His reflections are based on the first two years of the Peek-a-booty project." Interesting comments on media coverage,
3
3325
by: PWalker | last post by:
Hi, I have written code that I would like to optimize. I need to push it to the limit interms of speed as the accuracy of results are proportional to runtime. First off, would anyone know any resources that explains how to optimize code i.e. give some rules on c++ optimization? e.g. using memcpy to copy an array (which i have done). Also, what is the best sorting algorithm out there for sorting an array of of size 100 or less? I have...
8
2081
by: yellow1912 | last post by:
Ok, lets say I have 1000 items in my database (mysql) and want to display X items per page. I learned to do it by querying with the LIMIT constrain (something like this http://www.snipe.net/content/view/12/35/). The problem is I cant sort using this algorithm (or maybe I just dont know how to do it). ORDER BY didnt do the trick for me :(. The only way I can think of is to pass all the item keys/names/anything I want to sort into an array,...
5
4139
by: Bill Reid | last post by:
Hello, I am a just-beyond-beginning user of Access 97 on a Windows 98se machine (a single, non-networked home machine). All of a sudden I am unable to sort any of my tables. I click on any random heading to select the column, but the A\Z and Z\A buttons in the toolbar stay grayed out. This happens for any column on any table. I even created a test table since I first noticed this problem, but it also is not sort-able. I haven't...
1
1322
by: bob.hughes | last post by:
I'm trying to write a query that will find multiple transactions that take place within a pre-determined time limit. I can easily compute the time between adjacent transactions and then judge whether they fall within the time limit, but I can't figure out a way to do this for three or more transactions. Does anybody know how to do this?
6
6011
by: Mark | last post by:
hi, i want to display the five most recent rows in my table (there is a timestamp), but sorted in ascending order. the problem is that when i call SELECT * FROM spam ORDER BY time ASC LIMIT 5 it shows the first five entries in ascending order, but i want the last
4
1617
w33nie
by: w33nie | last post by:
I want to sort the following table, that contains this data, in a .php page I'll use on my website. I want to sort it by a few columns too, I want it to sort by points, then difference, then for. The following is the code I have in my .php file. <? $hostname = "***.secureserver.net"; // The mySQL DB server. $username = "acssl_table"; // The username you created for this database. $password = "Victoria3"; // The password you created...
10
5600
by: Woody Ling | last post by:
In 32 bits DB2 environment, is it meaningful to set sheapthres larger than 256MB for the following case.. 1. Intra-parallel is ON 2. Intra-parallel is OFF
20
2095
by: Bill Waddington | last post by:
This must be a FAQ - or several FAQs - but I can't quite seem to pin it down. I need to read a string from stdin which I will then process as digits with sscanf. I need to limit the # of chars read, and discard the rest of the line. I also need to detect when more or fewer chars are input. Something like GNU getline I guess. Is there a standard portable way to do this w/a library function, or do I just write it myself and process...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9187
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9053
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8936
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7776
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2360
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.