[] brackets in sql statements

前端 未结 8 2438
深忆病人
深忆病人 2020-11-28 12:24

What do the brackets do in a sql statement?

For example, in the statement:

insert into table1 ([columnname1], columnname2) values (val1, val2)

8条回答
  •  一个人的身影
    2020-11-28 13:00

    They allow you to use keywords (such as date) in the name of the column, table, etc...

    Since this is a bad practice to begin with, they are generally not included. The only place you should see them being used is by people starting out with sql queries that don't know any better. Other than that they just clutter up your query.

提交回复
热议问题