SQL join with related counts

Tim Davis timdavis at amug.org
Wed Aug 20 00:35:25 CDT 2003


>> I'm trying to list all rows of a table, with the quantities of its
>> child table records. Here's an example of what I've tried, which
>> crashes the server but not the app. (I'm using VServer and V4RB.)
>>
>> Select Parent.Field1, Parent.Field2, Count(Child1.ID),
>> Count(Child2.ID), Count(Child3.ID)
>> From Parent, Child1, Child2, Child3
>> Order By Parent.Field1
>
> You need to use GROUP BY Parent.Field1

The following changes produce the same results:
    adding Group By Parent.Field1
    same as above, without Order By Parent.Field1
VServer crashes each time.

Tim



More information about the Valentina mailing list