Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT MAX(Ref_ID) FROM Temp_A INTO ARRAY laTemp
NumTop = laTemp(1)
a=seconds()
NumTop=0
scan
If count>NumTop
NumTop=count
Endif
Endscan
b=seconds()
NumTop=0
scan
NumTop=iif(count>NumTop, count, NumTop)
Endscan
c=seconds()
SELECT MAX(count) FROM MyTable INTO ARRAY laTemp
NumTop=laTemp(1)
d=seconds()
CALCULATE MAX(count) to NumTop
e=seconds()
?b-a
?c-b
?d-c
?e-d
set order to tag ref_id desc
locate
luMax = ref_id
While I like Audiopro's suggestion (and somehow missed it the first time I read this thread), it wasn't noticeably faster for me (maybe an occasional 1/1000 of a second after half a dozen tests, with an occasional lead being on the other side) on about 10.5 million records tables.While select max(ref_id) from myTable would be very fast it wouldn't be as fast as audiopro's suggestion of ordering descending (assuming you had an index on ref_id) and taking the first one.