On Friday 31 January 2003 14:21, Luis Magaña wrote: > Hi, > > I have a question here: > > I have a table with this fields: > > month > description > amount > > now I have to write a query that retrieves the sum of the amount from > the minimum month to the maximum month registered for each diferent > description. >
>From what I understand in your email you just need to add a GROUP BY clause. Try a query like this. SELECT description, sum(amount) FROM table GROUP BY description; That should do what you need, Andy ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org