-- UPDATE users SET referred_by_id = 1 WHERE id IN (2, 3,10,18,15,20); -- User 1 referred Users 2 and user 3 and user 10 -- UPDATE users SET referred_by_id = 2 WHERE ...
The depth parameter for self-joins does not work as expected. It only applies correctly for depths 0 and 1. For example, if you have nested categories up to depth 5, the depth parameter will not fetch ...