Alex

Group by and Sum(1)

ie
select f1, f2, sum(1) from
table a join table b on a.pk = b.fk
group by f1, f2

HTH
Neven

----- Original Message -----
From: Alex Kouznetsov <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Tuesday, 13 March 2001 14:39
Subject: [DUG]: SQL question


> Is there a simple SQL construction to retrieve the values of all the
columns
> from a master table and a number of corresponding rows in details table ?
>
> Eg.
>
> 1,My first transaction, 10/12/2001, 20
> 2,My second transaction, 11/12/2001, 9
>
> Where 20 and 9 are number of details rows for each transaction stored in
> details table.
>
> I have tried to play with Count(), did not get too far.
>
> Thanks
>
>
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to