Max ID

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

buddybuddha

Established Member
Impact
2
Is there a quick way to tell what the maximum value for the id column is in a mysql db?
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Code:
SELECT `id` FROM `table_name` ORDER BY `id` DESC LIMIT 0,1

That will retrieve the very last column with only the `id` field returned. Then, depending on what language you are using, get the result of that. I don't know of any quicker ways though. (I havn't error checked that, :bah: )
 
0
Close
Thanks!
 
0
Close
PHP:
SELECT max(id) FROM table_name
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Search: choose where to search from the All tab
Open the search at the top of any page. On the All tab, the list next to the search box lets you choose where to search: everything, all...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back