4267067 298690 2010-07-05 00:59:15.187
>>>>>> 2010-07-05 01:32:48.300 1726 3212 1428 333
>>>>>> 4270023 298734 2010-07-05 01:59:02.497
>>>>>> 2010-07-05 02:32:48.780
On Thu, Jul 22, 2010 at 11:31:23AM +, Tim Landscheidt wrote:
> Richard Huxton wrote:
>
> >>> What I want to get is the values grouped by "subset", where a subset is a
> >>> set of rows with identical column until the colum changes.
> >>> Is there a way to get
>
> >>> | 2 | B |
> >>> | 4 | C
b.c) = '-1 day'::interval)
)
) th
ON fo.a = th.b
AND fo.b <= th.c
GROUP BY fo.parcela,fo.a,fo.b,fo.c
) tudo
GROUP BY tudo.a,tudo.c,tudo.d
To:
Sent: Thursday, July 22, 2010 9:09 AM
Subject: [SQL] grouping subsets
Hi,
having a table similar to
| 1 | B | [2010-07-15 Do] |
|
gt;>> L, ID B, but (!)
>>>> rows with same keys (R,L,B) should be summed up only until the keys change.
>>>> Do not sum up the components for identical keys, if there are other keys
>>>> between them.
>>>>
le b
ON (b.b <> a.b)
AND ((age(a.c,b.c) = '-1 day'::interval)
)
) th
ON fo.a = th.b
AND fo.b <= th.c
GROUP BY fo.parcela,fo.a,fo.b,fo.c
) tudo
GROUP BY tudo.a,tudo.c,tudo.d
To:
Sent: Thursday, July 22, 2010 9:09 AM
Subject: [SQL] grouping subsets
Hi,
having a table simi
a while, so I don't know if you are still interested in this
>>> problem or if you, in the meantime, found yourself a solution,
>>> but I've tried this on a local copy of the example you provided and it
>>> seems to work.
>>>
>>> The prob
,fo.a,fo.b,fo.c
) tudo
GROUP BY tudo.a,tudo.c,tudo.d
To:
Sent: Thursday, July 22, 2010 9:09 AM
Subject: [SQL] grouping subsets
Hi,
having a table similar to
| 1 | B | [2010-07-15 Do] |
| 1 | B | [2010-07-16 Fr] |
|---+---+-|
| 2 | C | [2010-07-17 Sa] |
| 2 | C | [2010-07-1
OUP BY se.a,se.b,se.c
> ) fo
> LEFT JOIN
> (
> SELECT a.*
> FROM yourTable a
> JOIN yourTable b
> ON (b.b <> a.b)
> AND ((age(a.c,b.c) = '-1 day'::interval)
> )
> ) th
> ON fo.a = th.b
> AND fo.b <= th.c
> GROUP BY fo.parcela,fo.a,fo.b,fo.c
>
l)
)
) th
ON fo.a = th.b
AND fo.b <= th.c
GROUP BY fo.parcela,fo.a,fo.b,fo.c
) tudo
GROUP BY tudo.a,tudo.c,tudo.d
To:
Sent: Thursday, July 22, 2010 9:09 AM
Subject: [SQL] grouping subsets
Hi,
having a table similar to
| 1 | B | [2010-07-15 Do] |
| 1 | B | [2010-07-16 Fr] |
|---+---+-
Rainer Stengele wrote:
> yes, the date is always incremented - but anyway the date
> column is not really the point! Actually the first tow
> columns are relevant. I want them gouped together as
> indicated, adding up column 1 in the blocks with identical
> second column, but not adding up over a
gt; The dates always follow that sequential pattern?
>
> Or can be holes on the dates sequence?
>
> Best,
> Oliveiros
>
> - Original Message - From: "Rainer Stengele"
>
> To:
> Sent: Thursday, July 22, 2010 9:09 AM
> Subject: [SQL] grouping s
Howdy, Rainer.
Please advice me,
The dates always follow that sequential pattern?
Or can be holes on the dates sequence?
Best,
Oliveiros
- Original Message -
From: "Rainer Stengele"
To:
Sent: Thursday, July 22, 2010 9:09 AM
Subject: [SQL] grouping subsets
Hi,
havi
Richard Huxton wrote:
>>> What I want to get is the values grouped by "subset", where a subset is a
>>> set of rows with identical column until the colum changes.
>>> Is there a way to get
>>> | 2 | B |
>>> | 4 | C |
>>> | 4 | B |
>>> | 3 | D |
>>> by SQL only?
>> I think, the problem is that
On 22/07/10 11:02, A. Kretschmer wrote:
In response to Rainer Stengele :
What I want to get is the values grouped by "subset", where a subset is a set
of rows with identical column until the colum changes.
Is there a way to get
| 2 | B |
| 4 | C |
| 4 | B |
| 3 | D |
by SQL only?
I think, t
In response to Rainer Stengele :
> Hi,
>
> having a table similar to
>
> | 1 | B | [2010-07-15 Do] |
> | 1 | B | [2010-07-16 Fr] |
> |---+---+-|
> | 2 | C | [2010-07-17 Sa] |
> | 2 | C | [2010-07-18 So] |
> |---+---+-|
> | 1 | B | [2010-07-19 Mo] |
> | 1 | B | [201
Hi,
having a table similar to
| 1 | B | [2010-07-15 Do] |
| 1 | B | [2010-07-16 Fr] |
|---+---+-|
| 2 | C | [2010-07-17 Sa] |
| 2 | C | [2010-07-18 So] |
|---+---+-|
| 1 | B | [2010-07-19 Mo] |
| 1 | B | [2010-07-20 Di] |
| 1 | B | [2010-07-21 Mi] |
| 1 | B | [2010
16 matches
Mail list logo