MySQL: re-use auto-increment during insert

后端 未结 3 386
-上瘾入骨i
-上瘾入骨i 2021-01-20 05:32

I\'m designing a comments MySQL db, and my comments table has fields:

  • id primary key, auto-incr
  • thread int, not null
3条回答
  •  北恋
    北恋 (楼主)
    2021-01-20 06:15

    You can simply set thread to NULL to signify that the comment is a root comment rather than attached to a thread.

提交回复
热议问题