SQL like subqueries

At present correlated SUB queries must required USE KEYS.

This may not efficient but you can use JOIN and generate array of results and then use ARRAY collection to match and update.

UPDATE bucket a 
SET a.some_value =  FIRST v.cnt FOR v IN 
                             (SELECT COUNT(1) AS cnt, c.some_value 
                               FROM bucket b JOIN bucket c 
                               ON b.some_value > c.somevalue 
                               WHERE .....
                              GROUP BY c.some_value)
                    WHEN a.some_value = v.some_value END;
1 Like