Simple Postgresql Statement - column name does not exists

前端 未结 2 1134
一向
一向 2020-11-27 23:31

I\'ve been pulling my hair out. I have a very simple postgre database, one specific table has a column named lName (uppercase N). Now I know with postgre I must quote lName

2条回答
  •  無奈伤痛
    2020-11-28 00:11

    I would guess:

     SELECT * FROM employee WHERE "lName" LIKE 'Smith'
    

    (note the different quotes; "foo" is a quoted identifier; 'foo' is a string literal)

    Also, in most SQL dialects, a LIKE without a wildcard is equivalent to =; did you mean to include a wildcard?

提交回复
热议问题