• Limitation I was referring is from front end side, which as I mentioned generates the SQL dynamically. The front end is not having this framework and does not support creating SQLs with UNION ALL .

    I understand the UNION ALL option is the right option in this case, however since front end does not support UNION ALL, we need to find some other alternative to get the desired results.

    Let us know if there can be any other option.