Note to self: works if I directly reference outer query column name from theinner query.
Still no Idea why it does not work with the alias.