473,385 Members | 1,588 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,385 software developers and data experts.

Mysql - Uses of Offset ?

147 100+
What is the purpose of OFFSET in mysql ?

Expand|Select|Wrap|Line Numbers
  1.    mysql>select * from info oFFSET 3 ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3' at line 1
Apr 5 '10 #1
3 8273
Atli
5,058 Expert 4TB
Hey.

Also see the part about LIMIT in the Manual (12.2.8. SELECT Syntax)

Basically, the MySQL syntax to LIMIT the rows a result set will return goes:
Expand|Select|Wrap|Line Numbers
  1. SELECT ... LIMIT x, y
Where "x" is the number of rows you want returned and "y" is the offset. (Offset meaning; the number of rows to remove from the top of the list.)
For example, if you have a 100 rows in the original result set a "LIMIT 10, 20" would return rows #21 through #30. That is; 10 rows starting after #20.

For compatibility with PostgreSQL, you can optionally replace the comma in the LIMIT syntax with the OFFSET keyword.
Expand|Select|Wrap|Line Numbers
  1. SELECT ... LIMIT x OFFSET y
However, this is optional. You don't need to do this unless you plan on building PostgreSQL compatible queries.
Apr 6 '10 #3
santhanalakshmi
147 100+
hi,
I got it....thanks for your response
Apr 6 '10 #4

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

Similar topics

4
by: Amadeus | last post by:
Hello Everybody! I have a problem with MySQL servers running RedHat 9 (smp kernel 2.4.20) on Intel and MySQL server 4.0.14 (problem also appears on binary distr 4.0.15 and on 4.0.15 I bilt myself...
3
by: raj | last post by:
whats the difference betwwen mysql and sql server2000 in terms of using storedprocedures,stored functions and views.
0
by: taras.di | last post by:
I'm trying to understand why MySQL isn't using all parts of the primary key when I add in an OR statement in the query. I have a people database, and a distances database. The people database...
4
by: Richard | last post by:
Hi All, I've been trying to build a Ruby-on-Rails plus MySQL application. I'm running Ruby 1.8.2, Rails 1.1.4 and MySQL 5.0.15-nt over WinXP-Pro/SP2. I run under an Administrative account. ...
1
by: aaron | last post by:
Output of "top" prior to initiation of mysql: load averages: 0.60, 0.97, 1.05 19:03:45 44 processes: 43 sleeping, 1 on cpu CPU states: 97.1% idle, 0.0% user, 0.8% kernel, 2.1% iowait, ...
1
by: jimmy | last post by:
I'm trying to insert a date into a MySQL date column. The string i am trying to insert takes the following format: 2007-02-23 which corresponds to the date format that MySQL uses which is...
2
by: info | last post by:
Ciao a tutti. Chiedo gentilmente il vostro supporto nell'aiutarmi a trovare la soluzione a questo problema su cui mi sono impantanato. Ho bisogno di visualizzare caratteri cirillici all'interno...
2
by: Dav1985 | last post by:
HI,I need to configure my.cnf for listening TCP/IP port and to write datas in MySql database ,Could you help me to do it?
30
by: Einstein30000 | last post by:
Hi, in one of my php-scripts is the following query (with an already open db-connection): $q = "INSERT INTO main (name, img, descr, from, size, format, cat, host, link, date) VALUES ('$name',...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.