MySQL Forums
Forum List  »  Newbie

Re: Displaying
Posted by: Shantanu Oak
Date: March 28, 2005 08:22PM

It would have been great if zerofill was allowed in an auto_incremented column. But it's not.

create table tmp3 (id int not null zerofill auto_increment primary key,
part char(16));

Error 1064 (You have an error in your SQL syntax near 'zerofill auto_increment, part char(16))' at line 1)

Therefore you have to add those zeros while displaying the records using LPAD
SELECT lpad(id,6,'0'), part FROM `tmp3` LIMIT 0,10

Options: ReplyQuote


Subject
Written By
Posted
March 28, 2005 07:51AM
Re: Displaying
March 28, 2005 08:22PM
March 28, 2005 10:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.