Subject | Re: This is a BUG !?! |
---|---|
Author | Marcos.Nobre@stj.gov.br |
Post date | 2001-10-11T16:00:29Z |
Perhaps I feel some difficulty in translating (to explain) this for
you. But see this :
Table : PEGA
ID_ALOJ_GRJ ID_ALOJ_GLP View : V_ALOJ_GALPAO_PEGOS
112 623 ID_ALOJ_GALPAO JA_PEGO
112 624 536 22141
112 624 537 11511
112 625 538 4645
112 537 539 4606
112 537 543 9391
112 630 623 12421
112 538 624 12587
112 538 625 12035
112 539 626 22384
112 536 627 969
112 536 630 4701
112 626
112 627
114 543
Wrong ResultSet is obtained by :
SELECT P.ID_ALOJ_GRJ, SUM(V.JA_PEGO)
FROM PEGA P JOIN V_ALOJ_GALPAO_PEGOS V ON (P.ID_ALOJ_GLP =
V.ID_ALOJ_GALPAO)
GROUP BY P.ID_ALOJ_GRJ
Why ? Do I think that GROUP BY should be executed on the Result of
JOIN, not?
TIA.
MN.
you. But see this :
Table : PEGA
ID_ALOJ_GRJ ID_ALOJ_GLP View : V_ALOJ_GALPAO_PEGOS
112 623 ID_ALOJ_GALPAO JA_PEGO
112 624 536 22141
112 624 537 11511
112 625 538 4645
112 537 539 4606
112 537 543 9391
112 630 623 12421
112 538 624 12587
112 538 625 12035
112 539 626 22384
112 536 627 969
112 536 630 4701
112 626
112 627
114 543
Wrong ResultSet is obtained by :
SELECT P.ID_ALOJ_GRJ, SUM(V.JA_PEGO)
FROM PEGA P JOIN V_ALOJ_GALPAO_PEGOS V ON (P.ID_ALOJ_GLP =
V.ID_ALOJ_GALPAO)
GROUP BY P.ID_ALOJ_GRJ
Why ? Do I think that GROUP BY should be executed on the Result of
JOIN, not?
TIA.
MN.
--- In ib-support@y..., Lucas Franzen <luc@r...> wrote:
>
> Marcos,
>
> just out of curiosity:
>
> what result do you get when you're doing a
>
> SELECT JA_PEGO FROM V_ALOJ_GALPAO_PEGOS V
> WHERE ID_ALOJ_GALPAO = 112
>
> Do you get the result:
>
> JA_PEGO
> 4320
> 1837
> 4320
> 4320
> 12421
> 12587
> 12587
> 12035
>
> ?
>
> You said that ID_ALOJ_GRJ is an integer column. Is this valid for
both
> columns (in both tables)?
>
> Luc.