Calculate an additional row from UNION results

MattP

Well-known member
Joined
Feb 29, 2008
Messages
1,206
Location
WY, USA
Programming Experience
5-10
I've run into a situation where I need to use UNION ALL to combine 3 queries (each returning 1 line) into a result set.

I have my queries set up in the following manner and am getting back the 3 rows of data as expected.

VB.NET:
SELECT...
UNION ALL
SELECT...
UNION ALL
SELECT...

The problem I'm having is that I need 2 additional rows of data that need to be calculated from the results. First query / Third query and Third query - First Query.

I can handle the code to add a row to my DataTable in VB.NET and calculate the results I need but I'm of the opinion that it's better to do this in the original request for data.
 
Back
Top