RE: [PHP] Querying for MAX
| From: | NCI/IMS) | Date: | Wed, 12 Jun 2002 18:39:17 +0000 |
| Subject: | RE: [PHP] Querying for MAX | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-db+get-19763@lists.php.net to get a copy of this message | ||
is
select MAX(<column name>)
what you are looking for? I know it works on numeric columns, I'm not sure
if it works on non-numbers, you'd have to look it up in a SQL Tutorial
somewhere.
Good luck!
-Natalie
-----Original Message-----
From: César Aracena [mailto:caracena@infovia.com.ar]
Sent: Wednesday, June 12, 2002 2:36 PM
To: 'PHP DB List'; PHP General List
Subject: [PHP] Querying for MAX
I'm sorry if this mensaje is posted twice. I sent it yesterdays, but then my
ISP had problems with e-mail and I lost dozens of them and don't know if
sent OK.
Hi all,
What I'm trying to do here is not inside PHP nor MySQL books I have. I need
to query the DB to look the max result in a column. That is, if I have
affiliate members with ID going from 1 to 10, get the query to know that the
last member added was 10 so I can add member 11 without using
auto_increment, because I need to insert old members too which already have
ID numbers. Is that possible?
Thanks in advance,
Cesar Aracena <mailto:webmaster@icaam.com.ar>
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621