user100
user100

Reputation: 69

how to give auto increment for a column in mysql?

I have table which contains three field id(primary key),number and note.Id is auto increment.I want data in this table in which number field contain current date with five digit number. For example current date is 24/11/2014,then my first entry become 201400001,second will be 201400002 and so on.On next year it will be 201500001,and so on. Please help me.

Thanks

Upvotes: 1

Views: 74

Answers (2)

Bhavya Shaktawat
Bhavya Shaktawat

Reputation: 2512

Refer Using Auto Increment in mysql

Upvotes: 1

Olivier Meurice
Olivier Meurice

Reputation: 562

Did you try "ALTER TABLE your_table AUTO_INCREMENT = initial_value" ?

Upvotes: 0

Related Questions