Sql

Asked • 05/14/19

MYSQL Update Statement Inner Join Tables?

I have no idea what the problem is. Using MySQL 5.0 i get a compile error when attempting to run the following MYSQL update statement UPDATE b SET b.mapx = g.latitude, b.mapy = g.longitude FROM business AS b INNER JOIN business_geocode g ON b.business_id = g.business_id WHERE (b.mapx = '' or b.mapx = 0) and g.latitude > 0 all the field names are correct. Any thoughts?

Matt S.

tutor
What is the compilation error you are getting? Are all the data types you are using consistent? You will have to verify that you are working with double and geospatial data types correctly.
Report

05/20/19

Matt S.

tutor
Also...if b.mapx is a float, it can never equal '' (double quotes). I think your WHERE clause should read WHERE(ISNULL(b.mapx) OR b.mapx = 0) AND g.latitude > 0
Report

05/20/19

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.