Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
How to select Top ten using sqlplus
Name: Jenny Han Date: July 15, 2003 at 21:56:03 Pacific OS: LINUX CPU/Ram: 16G
Comment:
Hi,
Now I'm wanting to retrieve the top ten data from a table using sqlplus but don't know exactly how.
It works fine if I use: select corp_cd, sum(delq) from rcrnsas.dataworldbkbl_rdd group by corp_cd order by sum(delq) desc;
But it won't work if I add 'limit 10' or 'top 10', like the following: select top 10 corp_cd, sum(delq) from rcrnsas.dataworldbkbl_rdd group by corp_cd order by sum(delq) desc; or select corp_cd, sum(delq) from rcrnsas.dataworldbkbl_rdd group by corp_cd order by sum(delq) desc limit 10;
Could anyone kindly help answer? Thanks in advance!
Name: programmerPhil Date: July 16, 2003 at 02:21:23 Pacific
Reply:
I think the 'top 10' part of the statement limits the number of records used in the filter as opposed to returning the top 10 records after the filter's been applied, so you'll be getting an ordered list of the first 10 records instead of the 'top 10' of the whole list.
You could try using your first SQL statement to store the results in a dataset (or similar) then use the 'top 10' thing on that to return the first ten records of that dataset.
Summary: Hi, I need help on how to write a script using batch to search for a particular file ext ie *.mp3 or *.jpg and save the particular file on a new created folder? ...
Summary: Hi, I have a question on SQL. Is there anyone here can show me (the SQL commands) how to delete the Top row (only the Top row) from a Access table using the SQL command? I have the following SQL comma...
Summary: I would like to include an option in my VC++ project using which the user can select if he wants to use dual processor for executing the project. In that case where can I find some examples of how to ...