Skip to Content
0

How to replace UNION ALL in query

Mar 07, 2017 at 10:07 AM

93

avatar image

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'
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Johan Hakkesteegt Mar 07, 2017 at 10:45 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Wojciech Domanski Mar 07, 2017 at 02:56 PM
0

Thank You. I will use two seprate queries then.

Regards

Wojciech

Share
10 |10000 characters needed characters left characters exceeded