I have the following update statement
UPDATE mytable
set tmax = (
SELECT tmax
FROM myvalues
WHERE Longitude_MAX >= v_lng and
STR_TO_DATE(Date, '%m/%d/%Y') = v_date
limit 1),
tmin = (
SELECT tmin
FROM myvalues
WHERE Longitude_MAX >= v_lng and
STR_TO_DATE(Date, '%m/%d/%Y') = v_date
limit 1),
where pkid = v_pkid;
its working but very slow, can we optimize it?
there are some example on net, but these join the both tables and have no such join.