Subject Re: Min and Max from detail table
Author maximshiryaev
Why not

select
m.master_id,
(select min(d.val) from detail d
where d.master_id = m.master_id),
(select max(d.val) from detail d
where d.master_id = m.master_id)
from master m

Maxim.

--- In firebird-support@yahoogroups.com, "Ed Dressel" <Dressel@...>
wrote:
>
> I need a min and max value from a detail table. Something like:
>
> select T1.Client_ID, Min(T2.Value1), Max(T2.Value2)
> from Table1 T1 left outer join T2 on T1.Client_ID = T2.Client_ID
> where...
> group by 1
>
> can this be done without a stored proc?
>
> Thanks in advance,
>
> Ed Dressel
>