JOIN needs to be within the same 'from_item' as the thing it's joining, rather than in a separate comma-separated bit.