4
INSERT INTO public."LeadCustomer"(
    "CustomerID", "FirstName", "Surname", "BillingAddress", "Email")
    VALUES ("12", "Lola", "Smith", "24 Cashmere Lane, Lancashire, LA4 6QT", "lolasmith@gmail.com");

ERROR:  column "12" does not exist
LINE 3:  VALUES ("12", "Lola", "Smith", "24 Cashmere Lane, Lancashir...
                 ^
********** Error **********

ERROR: column "12" does not exist
SQL state: 42703
Character: 111
4

1 回答 1

12

您会收到此错误,因为 PostgreSQL 使用双引号 ( ") 来表示系统标识符(例如表、列等),而使用单引号 ( ') 来表示文本。

您希望您的查询是:

INSERT INTO public."LeadCustomer"(
    "CustomerID", "FirstName", "Surname", "BillingAddress", "Email")
    VALUES ('12', 'Lola', 'Smith', '24 Cashmere Lane, Lancashire, LA4 6QT', 'lolasmith@gmail.com');
于 2017-04-05T13:12:57.013 回答