I am trying to reference the **a.pointer** inside a subquery but it looks like mysql doesn't allow to reference fields outside a subquery.

```
UPDATE order_items AS a

SET a.id_parent = (

SELECT id FROM((

select id from order_items as b where (b.pointer = a.pointer) and (b.id_parent = 0)) 

)x) 

WHERE a.id_parent > 9999

```

What is the best way to access the a.pointer inside the subquery?