Determining the MAX column value in a table (OpenInsight Specific)
At 26 OCT 1999 12:51:20PM Greg James, ISIS, Inc. wrote:
Using SQL ( PL/SQL actually ) there is a useful select statement that returns the max value of a column:
SELECT MAX( ) FROM ;
Is there an equivalent for this in R/LIST that won't bring the server to a grinding hault?
At 27 OCT 1999 06:08AM Oystein Reigem wrote:
Have you tried to run that SQL statement with the Exec_SQL function (programmatically or from the Sys Ed Exec Line)?
If it does work it might still take a long time. If the system doesn't store the max value anywhere it might have to do a sequential search of the table.
Unless the field is Btree-indexed of course. Then you can find the max value in the index. With not too much effort I think.
Btw - I don't think all SQL statements work in OI. I quote Cameron: "The SQL select command was broken in 3.61 as a side-effect of a fix to RTP9 which was intended to help with dots in file names. We are going to regress the fix, …" If you (or somebody else) can tell me how well (or badly) SQL statements perform in recent versions of OI I'd be grateful (I still use 3.61). Sometimes I really miss stuff like
delete from where
select count(*) from where
select count(*) from .
- Oystein -