database join update and delete

mysql update

update tblUser a inner join AppStore.tblUser b on a.imsi=right(b.imsi,15)
set a.sver=b.swver,a.pid = b.pid,a.brandid=b.brandid


mysql delete

DELETE t1, t2 FROM t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id;
或:
DELETE FROM t1, t2 USING t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id;
DELETE a FROM code_pool a inner join tmpcode b WHERE a.code=b.code

 

 

mssql delete

delete tblBillingLogData from tblBillingLogData a inner join ming12123 b 
on a.Mobile=b.mobile and a.ID<>b.id
where a.lastupdated>='2013-12-12 11:00' and SP='XL'

 
mssql update

update wuser set a.updatedate=b.logdate from wuser a inner join wlog b
on a.mobile=b.mobile

 

posted @ 2013-02-20 16:50  chy710  阅读(143)  评论(0)    收藏  举报