Table Function Must Be Used With Lateral Join