Check if a column exists in SQLite

前端 未结 15 515
我寻月下人不归
我寻月下人不归 2020-12-08 07:02

I need to check to see if a column exists and if it doesn\'t exist add it. From my research it looks like sqlite doesn\'t support IF statements and case statement should be

15条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 07:26

    Similar to IF in SQLite, CASE in SQLite is an expression. You can't use ALTER TABLE with it. See: http://www.sqlite.org/lang_expr.html

提交回复
热议问题