I requested an issue near to this yesterday but have to take it one step further. I understand that on any table you are able to specify what row to begin on and just how many rows to come back while using
SELECT ... LIMIT <start-row>, <length>
I additionally know that you could order tables on column heading while using
ORDER BY <column-name>
What I wish to know is, can there be anyway to mix these to ensure that MySQL will order a table alphabetically, after which only return a particular subset in the recently purchased table?
write both of them:
select foo from bar order by baz limit 0,10;
Yes, you simply add the 'Order By' after your WHEREs and GROUPs and before your LIMITs.
SELECT * FROM customers ORDER BY name LIMIT 0, 300