On Aug 31, 7:39 pm, Marcos Hercules Santos <mhe...@xxxxxxxxx> wrote: > hi guys > > I'm newbie in Psql and I'm trying to build one function in order to > count the products for each supplier. So i'm gonna put it quite simply > though this example > > Please, consider a table called books with the following fields > > bookid, title, price, idPublisher > > and one another table called publisher > > Idpublisher, name, city, Books > > Being in that last field from Publisher, called book, I gotta have the > amount of published books for each publisher. sorry guys, the last field in the publisher table is for the amount of books published by each Publisher Idpublisher, name, city, Books, amount_Books_ Guys, I'm discarding creating any view. I already have the query to count the data, but my problem is how to insert this data in the amount_books_ using function... thank goodness for the reply -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general