RE: Max int value of char field? How to find...

From: Date: Mon, 22 Oct 2001 07:20:00 +0000
Subject: RE: Max int value of char field? How to find...
Groups: php.general 
Request: Send a blank email to php-general+get-71799@lists.php.net to get a copy of this message
Good idea, but... Using floor produces the following error: Warning: SQL error: [MERANT][ODBC PROGRESS driver][PROGRESS]Invalid number string (7498), SQL state S1000 in SQLExecDirect in c:\program files\nusphere\apache\htdocs\mantist\cus\test.php on line 4 Warning: Supplied argument is not a valid ODBC result resource in c:\program files\nusphere\apache\htdocs\mantist\cus\test.php on line 5 1 The code: <? $con_id = odbc_connect("test", "sysprogress", "icl123"); $res_id = odbc_exec($con_id, 'SELECT MAX(floor(test)) FROM pub.test'); echo odbc_result($res_id, 1); ?> Simon. > -----Original Message----- > From: Terje Kristensen [mailto:terje@webon.net] > Sent: maandag 22 oktober 2001 8:52 > To: Kraa de Simon; Php-General (E-mail); MySQL (E-mail) > Subject: SV: Max int value of char field? How to find... > > > How about select max(floor(field)) from table ? > > TK > > > -----Opprinnelig melding----- > > Fra: Kraa de Simon [mailto:Simon.de.Kraa@icl.nl] > > Sendt: 22. oktober 2001 08:44 > > Til: Php-General (E-mail); MySQL (E-mail) > > Emne: Max int value of char field? How to find... > > > > > > Hello all, > > > > How can I find the highest integer value in a result set like: > > > > 1 > > 10 > > 11 > > 2 > > 3 > > a > > ab > > abc > > > > I'm looking for the value 11. > > > > The statement 'select max(field) from table' gives me 'abc' > so this won't > > do. > > > > Any ideas for a SQL statement that will do the trick? > > > > I'm using PHP / MySQL. > > > > Thanks! > > > > Simon. > > > > > --------------------------------------------------------------------- > > Before posting, please check: > > http://www.mysql.com/manual.php (the manual) > > http://lists.mysql.com/ (the list archive) > > > > To request this thread, e-mail <mysql-thread88614@lists.mysql.com> > > To unsubscribe, e-mail > <mysql-unsubscribe-terje=webon.net@lists.mysql.com> > > Trouble unsubscribing? Try: > http://lists.mysql.com/php/unsubscribe.php > > >

« previous php.general (#71799) next »