Posted by Chris Brownbill on 09/20/05 13:29
Can someone help a relative newcomer to SQL? (I dont think its a php
specific question but I am trying it in php).
I have two tables with a one to many relationship. I want to write a
query that will tell me how many records exist in the parent table for
which at least one record exists in the child table.
My current query (Select count) gives me the count of records in the
child table (ie the number of valid joins) - but I want to know the
number in the parent table regardless of how many records in the child
table (but must be at least 1).
Help much appreciated!
Navigation:
[Reply to this message]
|