Skip to Content
avatar image
Former Member

How to replace UNION ALL in query

Hi,

I would like to ask. How to write a query (SAP B1) to get the same result as below and avoid using “UNION ALL”. The reason is that yellow arrow link does not work properly when the query contains “UNION ALL”:

SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[U_OrderType] FROM ORDR T0 WHERE T0.[U_OrderType] = 'TRA'
UNION ALL
SELECT T1.[DocNum], T1.[DocDate], T1.[CardCode], T1.[CardName], T1.[U_OrderType] FROM OPOR T1 WHERE T1.[U_OrderType] = 'TRA'
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 07, 2017 at 10:45 AM

    Hi Wojchiech,

    The drill-down arrows are lost because the parser does not know to which table the DocNum belongs, when using UNION ALL.

    As such the only choice you have is to use two separate queries or to not have the drill down arrows.

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 07, 2017 at 02:56 PM

    Thank You. I will use two seprate queries then.

    Regards

    Wojciech

    Add comment
    10|10000 characters needed characters exceeded