Select a column with a keyword name

前端 未结 6 1021
感动是毒
感动是毒 2020-12-03 15:22

I have a table named \'test\'

It contains a column named \'AND\'

For that I use the following queries

insert into test values (\'a\',\'abc\')         


        
6条回答
  •  庸人自扰
    2020-12-03 16:01

    use backtick to escape keyword instead. just like how you created your table. using double quote or single quote will parse it into string that is why you're getting two records of and

    select `AND` from test;
    

提交回复
热议问题