473,387 Members | 2,436 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,387 software developers and data experts.

offset, limit problem

53
hi,
i have a problem in limit and offset with asc and desc

i tried the following code:
select * from tbl_name order by column_name asc limit 10 offset 15
it shows the 10 rows starting from 15. what i need is to show the same result but in desc order.
i used the code
select * from tbl_name order by column_name desc limit 10 offset 15 which shows the 10 rows but from the end of the table.

what shall be done to get the same result for asc and desc.
please any body can provide the query for the same.
with regards.
Apr 21 '08 #1
1 4116
rski
700 Expert 512MB
hi,
i have a problem in limit and offset with asc and desc

i tried the following code:
select * from tbl_name order by column_name asc limit 10 offset 15
it shows the 10 rows starting from 15. what i need is to show the same result but in desc order.
i used the code
select * from tbl_name order by column_name desc limit 10 offset 15 which shows the 10 rows but from the end of the table.

what shall be done to get the same result for asc and desc.
please any body can provide the query for the same.
with regards.
Maybe like that
Expand|Select|Wrap|Line Numbers
  1. select  *  from (select * from tbl_name  order by column_name asc limit 10 offset 15) t order by column_name desc;
  2.  
Does it work?
Apr 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michael Jordan | last post by:
I'm hoping that someone here can give me some insight into a problem I'm running into with Python, pywin32 and Excel. All-in-all using Python and pywin32 is great but I've run into a strange...
5
by: Jeff Boes | last post by:
Almost all of my foreign key definitions are NOT present in pg_constraint. However, they do exist as triggers. It appears that *new* foreign keys, whether defined in new tables or added on via...
0
by: D. Dante Lorenso | last post by:
I need to know that original number of rows that WOULD have been returned by a SELECT statement if the LIMIT / OFFSET where not present in the statement. Is there a way to get this data from PG ?...
24
by: funkyj | last post by:
PROBLEM STATEMENT: I want to calculate the byte offset of a field with a struct at compile time without instantiating an instance of the struct at runtime AND I want to do this in an ANSI standard...
1
verbatim
by: verbatim | last post by:
I’m having a problem with FF2.0 trying to find the y offset of an object. I've tried several different scripts; all seem to be similar to this one. I keep getting strange values for the Y offset....
1
by: C. | last post by:
Hi, First off, apologies for posting here - I can't find a dedicated SQLite newsgroup The other thing I can't find is how to retrieve the total number of rows which would have been returned...
8
by: printline | last post by:
Hello I have a problem which i hope someone can help me with. I have a website where customers can login and their current and previous orders. What i need now is for the customers to look...
2
by: =?Utf-8?B?Sm9ubnk=?= | last post by:
I have an ASP.NET 2.0 C# web application that is contacting an Exchange server using WEBDAV. It allows the users to look up appointments for a future date. The problem I have is determining the...
8
by: Thomas Mlynarczyk | last post by:
Hello, I want to split a given string into tokens which are defined by regexes: // example tokens - a bit more complex in real $tokens = array( 'NUMBER' ='~^\d+~', 'NAME' ='~^+~', 'ANY' ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.