Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Query

Is it possible to hav query like this?

Select a1, b1, c1, a1 from Tabl1

Union all

Select a2, b2, c2, ('a1-a2') from tabl2

ie i need a column value of second query in such a way it takes a value of previous query for any operations.

Meera.

Former Member
Former Member replied

Meera,

It has be more like

Select a1, b1, c1, a1 from Tabl1

Union all

Select a2, b2, c2, (Select a1 from Tabl1)-a2 from tabl2

Please note a1 in the sub select should return only one value, otherwise SQL will return error.

Suda

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question