RSS

Archive for January, 2008

[SQL语句]把所有的数据记录修改成Id = 1的记录 

January 24, 2008 | mysql 数据库

群里朋友的问题.表名叫test,结构如下 就是把ID为2,3...的值,使用一个SQL语句,直接改为dsf 用 update test set a=(select b from test where id='1') where 1 提示错误: SQL execution error # 1093 Response from the database: You can't specify target table 'test' for upadte in FROM clause 早上问过fluke,这句可以实现: UPDATE test, ( SELECT b AS sub_data FROM test WHERE Id = 1 )q1 SET test.b = q1.sub_data WHERE 1 再更新: (by耿勇) update test as aa,test as bb ...

青岛-雪

January 11, 2008 | 影像故事

本来是个很诗意的标题. 但最近很是一阵乱忙,就不赋诗啦. 上图: