pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Another Trad <anothertrad@gmail.com>
To: pgsql-sql@postgresql.org
Subject: need nelp with aggregate functions
Date: Wed, 18 Nov 2009 13:55:16 -0300
Message-ID: <af7271950911180855n4ec2b0b1y484382a1123d903d@mail.gmail.com> (raw)

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?

Attachments:

MODEL.jpg (image/jpeg, 20.7K) download view image

view thread (6+ messages)  latest in thread

Message-ID: <af7271950911180855n4ec2b0b1y484382a1123d903d@mail.gmail.com>
Permalink:  ../af7271950911180855n4ec2b0b1y484382a1123d903d@mail.gmail.com/
Also on:    postgresql.org/message-id/af7271950911180855n4ec2b0b1y484382a1123d903d@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: anothertrad@gmail.com
  Subject: Re: need nelp with aggregate functions
  In-Reply-To: <af7271950911180855n4ec2b0b1y484382a1123d903d@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox