Subject | Re: R: [firebird-support] 1 a n relationship with GROUP BY conditioned on master |
---|---|
Author | Mark Rotteveel |
Post date | 2011-12-07T16:15:49Z |
On Wed, 7 Dec 2011 17:03:29 +0100, "P-Soft - Codebue Fabio"
<f.codebue@...> wrote:
SELECT SUM(b3), b2
FROM A
INNER JOIN B ON B.b1=A.a1
WHERE a2 = ? -- Your filter condition
GROUP BY b2
If that is not what you want, you need to be more specific :)
Mark
<f.codebue@...> wrote:
> I have 2 tableson
> A
> fields a1, a2, a3
>
> B
> Fields b1 ,b2, b3, b4
>
> I need to create a SQL retrieve sum(b3) and aggregate on b2 and filter
> a2 where a1=b1Something like:
>
> Some idea?
SELECT SUM(b3), b2
FROM A
INNER JOIN B ON B.b1=A.a1
WHERE a2 = ? -- Your filter condition
GROUP BY b2
If that is not what you want, you need to be more specific :)
Mark