Subject Re: R: [firebird-support] 1 a n relationship with GROUP BY conditioned on master
Author Mark Rotteveel
On Wed, 7 Dec 2011 17:03:29 +0100, "P-Soft - Codebue Fabio"
<f.codebue@...> wrote:
> I have 2 tables
> 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
on
> a2 where a1=b1
>
> Some idea?

Something like:

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