Hi,
When a subquery is used in from or join clause the query alias and the alias used in the ON condition when joining should be the same (case sensitive).
example :: The alias tableAP when used in join ON condition it is used as TableIP. This will be fixed in future releases.
Let me know if this solves your issue.