clintonwhite
IS-IT--Management
Hi There,
I have tried loking through the documentation for this one, but can not seem to find anything.
I have a table that contains hundreds of rows for different machines and I want to be able to select at most 20 rows out of the table, based upon the id of the required machine. I would like to retrieve the most recent 20 rows if possible, as there is a date column in the table - however I can not seem to do this, unless I retrieve all of the rows from the table for the required machine id, sorted by ascending date and them go last and count back for 20 rows.
Is anyone aware of any condition that I can use on the select statement to achieve the same result.
Thanks for you help.
I have tried loking through the documentation for this one, but can not seem to find anything.
I have a table that contains hundreds of rows for different machines and I want to be able to select at most 20 rows out of the table, based upon the id of the required machine. I would like to retrieve the most recent 20 rows if possible, as there is a date column in the table - however I can not seem to do this, unless I retrieve all of the rows from the table for the required machine id, sorted by ascending date and them go last and count back for 20 rows.
Is anyone aware of any condition that I can use on the select statement to achieve the same result.
Thanks for you help.