-2
UPDATE jos_ezrealty

  SET jos_ezrealty.locid = p.id

,jos_ezrealty.locality = p.locality

,jos_ezrealty.owncoords = 1

FROM poblacion p

  WHERE jos_ezrealty.alias LIKE '%' || p.locality || '%'

それは私に与えます:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM poblacion p WHERE jos_ezrealty.alias LIKE '%' || p.locality || '%'' at line 5

4

2 に答える 2

2

UPDATEMySQLの構文を読んでください。

UPDATE jos_ezrealty AS e
  JOIN poblacion p
    ON e.alias LIKE '%' || p.locality || '%'
SET e.locid = p.id
  , e.locality = p.locality
  , e.owncoords = 1 ;
于 2012-05-22T11:40:31.747 に答える
1

次のようになります。

UPDATE jos_ezrealty join poblacion 

SET jos_ezrealty.locid = p.id

,jos_ezrealty.locality = p.locality

,jos_ezrealty.owncoords = 1

WHERE jos_ezrealty.alias LIKE CONCAT('%', p.locality, '%');
于 2012-05-22T11:46:53.807 に答える