Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Retrieve * Columns Last Row
I'm plugging temps in a table every 5 minutes, I want to pull the latest reading and put it on a screen. All fields are 1/0 except the stamp field which is date.
Can you help?
ORDER BY {Col} DESCORDER BY is an optional clause which will allow you to display the results of your query in a sorted order (either ascending order or descending order) based on the columns that you specify to order by.
DESC would cause the Last item to now become the first in the result set. So you might be able to do a single qfetch....
Here is a good SQL reference website:http://sqlcourse2.com/orderby.html
SELECT columnA, columnb, stamp FROM table WHERE stamp IN(SELECT MAX(stamp) FROM table)
SELECT TOP 1 * FROM tbl_ping ORDER BY stamp DESCThen I can simply read the first record and throw the rest out.
Article ID: W15060
File Created: 2002:09:05:13:49:24
Last Updated: 2002:09:05:13:49:24