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 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'
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
on a.mobile=b.mobile
浙公网安备 33010602011771号