Re: The biggest actual value in a Key-Field

2004-01-31 Thread mos
A.J. Millan, At 01:31 PM 1/31/2004, you wrote: In respect to ORDER BY ... DESC combined with LIMIT 1: I´v arrived to this other for my own (thank you anyway), but I suspect that maybe it is not very efficient from the computation point of view (I suppose it must travel the whole table to discard

Re: The biggest actual value in a Key-Field

2004-01-31 Thread Fred van Engen
On Sat, Jan 31, 2004 at 08:31:38PM +0100, A.J.Millan wrote: > LAST_INSERT_ID() function: > > This other one has proven before, but in my case it returns many results (in > fact, the last one es the desired data). > It will return a single result if you just do this: SELECT LAST_INSERT_ID(); Do

Re: The biggest actual value in a Key-Field

2004-01-31 Thread Roger Baklund
* A.J.Millan > In respect to SHOW TABLE STATUS LIKE "tablename" > > Seemingly it doesn't work. It would require that you have allready issued "USE dbName", or started the client with dbName as a parameter, making it the 'current' database. > The sintax SHOW TABLE STATUS FROM dbName > > Work fin

Re: The biggest actual value in a Key-Field

2004-01-31 Thread A.J.Millan
Roger: Thank you for your kind answer. In respect to SHOW TABLE STATUS LIKE "tablename" Seemingly it doesn't work. The sintax SHOW TABLE STATUS FROM dbName Work fine, but it works at database level (can present access problems). Also must obtain the result for ALL the tables in the database

Re: The biggest actual value in a Key-Field

2004-01-31 Thread Roger Baklund
* A.J.Millan > Supposing that fieldName is the a primary numeric auto-increment Key field > in a table. > Does exist some direct method to find the biggest fieldName value actually > stored? (without scan across all the table) There are several ways to do this, which way to use depends on the situ