修改方法如下,
偶的create table语句如下:CREATE TABLE players (
name VARCHAR(30),
id SERIAL PRIMARY KEY,
wins INTEGER DEFAULT 0,
matches INTEGER DEFAULT 0
);
偶正在运行以下PostgreSQL查询(在Python函数中-将播放器插入数据库):
^{pr2}$
接下来是这个:query = "SELECT id, name, wins, matches\
FROM players ORDER BY wins DESC;"
尝试运行脚本时,出现以下错误:ProgrammingError: column "id" of relation "players" does not exist
偶试过去掉id列,只选择wins,但它告诉偶它也不存在。偶还尝试将玩家表更改为以下内容:CREATE TABLE players (
name VARCHAR(30),
id SERIAL PRIMARY KEY,
wins INTEGER,
matches INTEGER
);
INSERT语句是:query = "INSERT INTO players (name, wins, matches) VALUES (%s,%s,%s);"
c.execute(query,(name,0,0))
并收到以下错误:ProgrammingError: column "wins" of relation "players" does not exist
偶运行了一个简单的SELECT*FROM players;在偶的终端中,它返回这个表,所以列肯定在那里。。。在name | id | wins | matches
lumia1520充电器插头怎么用,前端vue项目 怎么打包编译,qq怎么清除空间说说lumia1520充电器插头怎么用,前端vue项目 怎么打包编译,qq怎么清除空间说说