Browsing articles tagged with " database"
Oct
22
2011

Mysql autoincrement column that resets every month

There are situations when we need an autoincrement field to reset every month or so. Example : Invoice Numbers : Month of october Month of november and so on. Groupwise autoincrement P1 , P2 , Q1 , Q2 , Q3 , Q4 , P3 , R1 , P4 … Myisam table has a feature where , if a primary key contains 2 columns where one is an autoincrement and other is a varchar , then [...]