sql 语法
update table2 set id = (select id from table2 limit 1);
或
update table2 set id in (select id from table2 );
貌似我这样写,语法不对..我要达到上述功能要怎么写?
------解决方案--------------------
python:
UPDATE="update table2 set id = %s"
SELECT="select id from table2 limit 1"
cur.execute(SELECT)
ID=cur.fetchone()
cur.execute(UPDATE,ID)