cancel
Showing results for 
Search instead for 
Did you mean: 

Query

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

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

Answers (0)