Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在 python 中使用 mySQLdb 将数据导入数据库,但是我也希望能够处理特定行并更新该行中的单元格,我在 mySQLdb 帮助中找不到执行此操作的命令文件,任何人都会好心地指出我正确的方向......
谢谢,
您可以使用 sql UPDATE语句
伪数据架构:
# table people id INT, name VARCHAR(40), age INT, address VARCHAR(100) 1, john, 33, North America 2, dm03514, 28, Maryland
使用 pythong MySQLdb
cursor.execute('UPDATE people SET address = %s WHERE id = %s', ('Columbia, MD', 2));