CREATE TABLE members (
memberID SERIAL,
username VARCHAR(255) NOT NULL,
password VARCHAR(60) NOT NULL,
email VARCHAR(255) NOT NULL,
active VARCHAR(255) NOT NULL,
resetToken VARCHAR(255) DEFAULT NULL,
resetComplete VARCHAR(3) DEFAULT 'No',
CONSTRAINT members_pk PRIMARY KEY (memberID)
);
我正在尝试在PostgreSQL数据库中使用提供的语句,但是当我尝试执行它时,我收到语法错误:
ERROR: syntax error at or near "CREATE" LINE 1: SELECT COUNT(*) AS total FROM (CREATE TABLE members (
据我所知,我的SQL很好。我不确定这里出了什么问题。
答案 0 :(得分:-3)
CREATE TABLE members (
memberID SERIAL CONSTRAINT members_pk PRIMARY KEY,
username VARCHAR(255) NOT NULL,
password VARCHAR(60) NOT NULL,
email VARCHAR(255) NOT NULL,
active VARCHAR(255) NOT NULL,
resetToken VARCHAR(255) DEFAULT NULL,
resetComplete VARCHAR(3) DEFAULT 'No'
);
移动约束语法有帮助吗?