SQL Auto-Increment by DateTime

前端 未结 2 704
忘了有多久
忘了有多久 2021-01-06 13:59

Is there a way in my sql to auto increment by the date and time?

so say I have a table

                         mytable
 ============================         


        
2条回答
  •  花落未央
    2021-01-06 14:13

    You can set a default value for your datetime column, now(). This way whenever you add a row, it will automatically get current datetime.

提交回复
热议问题