need nelp with aggregate functions

From: Another Trad <anothertrad(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: need nelp with aggregate functions
Date: 2009-11-18 16:55:16
Message-ID: af7271950911180855n4ec2b0b1y484382a1123d903d@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The DB structure is in attachment.
I with the number of clients and the number of computers that have
processors with "manufacturer" = "INTEL" and "speed" = "2GB"
I am trying:

select count(c) as qtd_client, count(cm) as qtd_computers
from cliente c
inner JOIN computer cm on (c.cliente_id = cm.cliente_id)
inner join processor p on (cm.processor_id = p.processor_id)
inner join speed s on (s.speed_id = p.speed_id)
INNER JOIN manufacturer m on (p.manufacturer_id=m.manufacturer_id)
where m.manufacturer = 'INTEL'
and s.speed = '2GB'

but is not working
anyone can help me?

Attachment Content-Type Size
image/jpeg 20.7 KB

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2009-11-18 17:07:59 Re: need nelp with aggregate functions
Previous Message Edward W. Rouse 2009-11-18 15:10:42 Re: lost password