Re: max unique number

From: Date: Tue, 07 Mar 2006 17:39:42 +0000
Subject: Re: max unique number
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-231609@lists.php.net to get a copy of this message
Philip Hallstrom wrote: >> [snip] >> How do i get a unique max number from a mysql table column? >> [/snip] >> >> SELECT MAX(number) FROM table LIMIT 1; > > That might not be unique though... I'm wondering if the original poster > is looking for AUTO_INCREMENT (ie. sequences) to ensure a unique id to > use for insertion...? > mysql_insert_id() should do the trick for an automatically incremented sequence.

« previous php.general (#231609) next »