我想把article表中A字段的內容復制到article表中B字段裡面sql語句為:
代碼如下 復制代碼update article set B=A;
例子
代碼如下 復制代碼UPDATE file_manager_folder f1
LEFT OUTER JOIN file_manager_folder f2
ON f1.name = f2.name AND f2.parentId = 54
SET f1.parentId = 54
WHERE f2.name IS NULL AND f1.id IN (1,2,3);
sql語法這樣寫。
例子
mysql> UPDATE v95_soft a
RIGHT JOIN dp_softlist b ON a.id = b.softid
SET a.catid = b.softclassid;
mysql> UPDATE v95_soft set url = CONCAT(url,id);
mysql> UPDATE v95_soft set url = CONCAT(url,catid);
mysql> UPDATE v95_soft a
RIGHT JOIN dp_softlist b ON a.id = b.softid
SET a.start = b.softscore;
mysql> UPDATE v95_soft a
RIGHT JOIN dp_softlist b ON a.id = b.softid
SET a.updatetime = UNIX_TIMESTAMP(b.softcreatedate);
mysql> update v95_soft set sysadd=1;