Results 1 to 2 of 2

Thread: Counts

  1. #1
    Join Date
    Dec 1969

    Default Counts

    I have a table of forum posts called parents and a table of child forum posts called children. These have a UserID which connects to a table of users. <BR><BR>I want to be able to select each user and generate a total of parents and children each member has. How is this done?

  2. #2
    Join Date
    Dec 1969

    Default RE: Counts

    select userName, <BR>(select count(*) from parents where userid = u.userid) + <BR>(select count(*) from children where userid = u.userid) as total<BR>from users u

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts