MySQL Forums :: InnoDB :: Does LIMIT 1 without ORDER BY ID bring the record with minimum ID?


Advanced Search

Does LIMIT 1 without ORDER BY ID bring the record with minimum ID?
Posted by: Panayotis Matsinopoulos ()
Date: May 03, 2012 01:19AM

According to this:

http://forums.mysql.com/read.php?21,239471,239688#msg-239688

InnoDB returns the rows in PRIMARY KEY order.

Does this stand true if you put LIMIT at the end? In other words:

Does

SELECT * from MYTABLE LIMIT 1;

bring always the record with the minimum id? Or shall I put ORDER BY ID before LIMIT?

Thanks in advance.

Panayotis

Options: ReplyQuote


Subject Views Written By Posted
Does LIMIT 1 without ORDER BY ID bring the record with minimum ID? 2111 Panayotis Matsinopoulos 05/03/2012 01:19AM
Re: Does LIMIT 1 without ORDER BY ID bring the record with minimum ID? 1685 Rick James 05/03/2012 09:24PM
Re: Does LIMIT 1 without ORDER BY ID bring the record with minimum ID? 1369 Panayotis Matsinopoulos 05/04/2012 02:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.