2016-08-18 9 views
0

に参加する:MYSQLの更新が

UPDATE video v,akadam_post a,location l 
SET v.location_id=l.id 
WHERE a.encoding_id=v.id AND l.continentCode=a.loc_continent_code AND 
l.countryCode=a.loc_country_code AND l.regionCode=a.loc_region_code AND 
l.cityCode=a.loc_city_code 

私は、構文エラー、どんなアイデアを得ますか?

10:04:02 select id,encoding_id from akadam_post a left join location l on l.continentCode=a.loc_continent_code AND l.countryCode=a.loc_country_code AND l.regionCode=a.loc_region_code AND l.cityCode=a.loc_city_code UPDATE video v,akadam_post a,location l SET v.location_id=l.id WHERE a.encoding_id=v.id AND l.continentCode=a.loc_continent_code AND l.countryCode=a.loc_country_code AND l.regionCode=a.loc_region_code AND l.cityCode=a.loc_city_code Error Code: 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 'UPDATE video v,akadam_post a,location l SET v.location_id=l.id WHERE a.encoding' at line 3 0.00051 sec 

ありがとう!

+0

として、あなたは別のクエリからエラーを雇っているはず? – 1000111

+0

特に目立つものはありません。関係する3つのテーブルのテーブル構造(列名とキー列)を共有できますか? –

答えて

1

構文が正しくありません、それは

update video v 
join akadam_post a on a.encoding_id=v.id 
join location l on l.continentCode=a.loc_continent_code 
and l.countryCode=a.loc_country_code and l.regionCode=a.loc_region_code 
and l.cityCode=a.loc_city_code 
set v.location_id=l.id 
+0

問題はMySQLworkbenchから来ていて、コマンドラインを使ってこの問題を解決しました。私はその文字列に隠された特別な文字があると思う。 –