September 21, 2004 at 3:44 am
I have 8 tables that contain a 'Total' field, what I want to do is the following:
The idea is that the value returned by the stored procedure will be the lowest 'Total' value of the 8 tables.
September 21, 2004 at 3:57 am
Either loop through all 8 tables, as you suggest, or do a:
select min(x.total)
from
(
select total from table1 where...
union
select total from table2 where...
union
select total from table3 where...
....
) x
/Kenneth
September 21, 2004 at 9:31 am
Thanks Kenneth
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply