RsD0p9BK
4/6/2015 - 1:11 PM

update__inner.sql

-- update inner where

UPDATE business AS b
INNER JOIN business_geocode AS g ON b.business_id = g.business_id
SET b.mapx = g.latitude,
  b.mapy = g.longitude
WHERE  (b.mapx = '' or b.mapx = 0) and
  g.latitude > 0
  
-- http://stackoverflow.com/questions/8057565/mysql-update-statement-inner-join-tables  
-- update inner

UPDATE wifcms_mod_geodata__address as t2  
  INNER JOIN wifcms_mod_ads_areas_alias as t1 
	  ON t1.aa_id = t2.aa_id
SET t2.area_id = t1.area_id

-- http://dba.stackexchange.com/questions/21152/how-to-update-one-table-based-on-another-tables-values-on-the-fly