MySQL Forums
Forum List  »  InnoDB

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?
2324
May 03, 2012 01:19AM


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.