Refer to existing object inside sqlQuery

I cannot remember where I first found out about it, but this post has an example: