On 18/04/2014 10:29, Josef Kokeš wrote:
On 18.4.2014 11:10, Thomas Beckmann wrote:
Hi Josef,
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
Hi!
I am struggling with a particular select, trying to get it to execute as
efficiently as possible. I have tables MASTER(ID, NAME, ...) and
DETAIL(ID, MASTER_ID, VALUE1, VALUE2, VALUE3). The SELECT I want to get
would display all fields from MASTER and an aggregation of fields from
DETAIL, e.g.
Hi Josef,
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),
Hi Josef
W dniu 18.04.2014 10:49, Josef Kokeš pisze:
Hi!
I am struggling with a particular select, trying to get it to execute as
efficiently as possible. I have tables MASTER(ID, NAME, ...) and
DETAIL(ID, MASTER_ID, VALUE1, VALUE2, VALUE3). The SELECT I want to get
would display all fields
I would consider the this second option, but I would change the join:
SELECT ...
FROM DETAIL
LEFT JOIN MASTER
Check on your real structure and data if it helps
Hi!
Unfortunately, this is not applicable to my case, as I do have MASTERs
which have no DETAIL (yet).
Josef
On 18.4.2014 11:10, Thomas Beckmann wrote:
Hi Josef,
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
Josef
W dniu 18.04.2014 11:28, Josef Kokeš pisze:
I would consider the this second option, but I would change the join:
SELECT ...
FROM DETAIL
LEFT JOIN MASTER
Check on your real structure and data if it helps
Hi!
Unfortunately, this is not applicable to my case, as I do have MASTERs