Subject | Re: [firebird-support] Efficient subselects |
---|---|
Author | Josef Kokeš |
Post date | 2014-04-18T09:29:29Z |
On 18.4.2014 11:10, Thomas Beckmann wrote:
for my needs.
Thanks!
Josef
> Hi Josef,Interesting approach. I will consider it, maybe it would be sufficient
>
> what I figured out to be quite handy, is to write something like:
>
> select
> MASTER.*,
> cast(left(S, 10) as bigint),
> cast(substring(S from 10 for 10) as bigint),
> cast(right(S, 10) as bigint),
> from (SELECT MASTER.ID,
> (SELECT
> lpad(SUM(VALUE1), 10) ||
> lpad(MAX(VALUE2), 10) ||
> lpad(MIN(VALUE1), 10)
> FROM DETAIL
> WHERE DETAIL_ID=MASTER.ID) as S
> FROM MASTER
> WHERE NAME STARTING WITH 'A') s
> join MASTER m on m.ID = s.ID
>
> Thomas
for my needs.
Thanks!
Josef