尝试在表上运行更新脚本,但收到错误:
错误:列"确定"不存在 第2行:SET first_name =" ok",last_name =" pk",email =" ooo",phone =" ...
CREATE TABLE employee (
employee_id SERIAL PRIMARY KEY,
first_name varchar(255) NOT NULL,
last_name varchar(255) NOT NULL,
email varchar(255) NOT NULL,
phone varchar(255)
);
INSERT INTO employee(
first_name, last_name, email, phone)
VALUES ('Kyle', 'Belanger', 'kbelanger@ok.com', '(240) 298-4664');
UPDATE "employee"
SET first_name="ok", last_name="pk", email="ooo", phone="000"
WHERE employee_id = 1;
答案 0 :(得分:1)
无需在双引号"employee"
中包装表名,并使用单引号作为列值
UPDATE employee
SET first_name='ok', last_name='pk', email='ooo', phone='000'
WHERE employee_id = 1;
答案 1 :(得分:0)
尝试下面的sql:
UPDATE employee
SET first_name='ok', last_name='pk', email='ooo', phone='000'
WHERE employee_id = 1;
表名用双引号括起来,不允许。