2010-10-23 21 views

risposta

9
SELECT `AUTO_INCREMENT` 
    FROM `information_schema`.`TABLES` 
WHERE `TABLE_SCHEMA` = SCHEMA() 
    AND `TABLE_NAME` = 'tbl_name'; 
10
SHOW TABLE STATUS LIKE "tablename"; 

colonna auto_increment mostrerà il conteggio.

1

È possibile utilizzare la funzione LAST_INSERTED_ID.

+1

Non esiste una funzione 'LAST_INSERTED_ID',' LAST_INSERT_ID' è specifica della connessione non specifica della tabella. Questa risposta non è corretta. – chx

Problemi correlati