1.基礎(chǔ)語(yǔ)法
UPDATE table_name SET column1 = value1, column2 = value2...., columnN = valueN WHERE [condition]; 例如:
例:update tb set UserName="XXXXX" where UserID="aasdd"
2.對(duì)某些字段變量+1,常見(jiàn)的如:點(diǎn)擊率、下載次數(shù)等
update tb set clickcount=clickcount+1 where ID=xxx
3.將同一記錄的一個(gè)字段賦值給另一個(gè)字段 update tb set Lastdate= regdate where XXX
4.多表聯(lián)合更新記錄
4.1將一個(gè)表中的一批記錄更新到另外一個(gè)表中
update table1,table2 set table1.f1=table2.f1,table1.f2=table2.f2 where table1.ID=table2.ID
更多建議: