Hey good timing Neven,
I was just about to start looking for an alternative to
COUNT(DISTINCT(idno)) for a database that doesn't support it. Now I'll try
your sum(1).
thanks,
Steve
> -----Original Message-----
> From: Neven MacEwan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 13 March 2001 16:19
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: SQL question
>
>
> 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"
>
---------------------------------------------------------------------------
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"