Using a query as a condition for an update query

Have you considered using a custom query using an IN clause and a subquery

Something like

SELECT * FROM table1
WHERE field = value AND  myvalue IN (SELECT myvalue
         FROM table2
         WHERE postcode = ''a value here')

Basically the sub query would do the postcode and the primary query could calculate the distance (using something like the haversign formula)

See below which is now easy with custom queries.

2 Likes