danrevah — 2011-01-25T16:59:42-05:00 — #1
How can I Select and get from the end on the list
instade from the start?
furicane — 2011-01-25T17:17:19-05:00 — #2
You should probably ask the question in the appropriate forum (this is PHP, not SQL) and give more info about what you want and what you have at your disposal.
To cut it short, you don't "select from the end", you give the select criteria and order the result the way you want to see it (ascending / descending) based on a key. You probably need some condition to filter unwanted results too.
It's easy to google it out with information I provided so I won't post examples.
raj23 — 2011-01-27T00:55:45-05:00 — #3
Just type the following code in mysql
SELECT EMP_NAME FROM EMP_TABLE
ORDER BY EMP_NAME DESC
FETCH FIRST n ROWS ONLY
guido2004 — 2011-01-27T02:59:04-05:00 — #4
In MySQL this is called LIMIT.
r937 — 2011-01-27T03:11:30-05:00 — #5
not only is the syntax wrong for mysql, raji, but that's a very sloppy example
your WHERE clause identifies a single employee, so there won't be more than one row to sort, much less take the first n rows of...