Search Postgresql Archives

joining a query with a select count(*)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I want a query to return all the rows from one table along with a count of rows in another table that reference each returned row from the first table.

For instance, if you had a table of children and another table of grandchildren that had a foreign key on the children table, I'd want to return all children with a count of the number of kids they had.

I hope I can figure it out before I get a reply.

Thanks


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux