pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Raj A <raj.ayappan@gmail.com>
To: pgsql-sql@postgresql.org
Subject: aggregate query
Date: Tue, 29 May 2007 14:32:32 +1000
Message-ID: <ddcb1c340705282132p656de07cy5618de275fc1f1f7@mail.gmail.com> (raw)

I have a table

CREATE TABLE survey_load
(
  meter_id character(5) NOT NULL,
  number_of_bays integer NOT NULL,
  bay_1_use integer,
  bay_2_use integer,
  bay_3_use integer,
  bay_4_use integer,
  bay_5_use integer,
  date date NOT NULL,
  inspection_id integer NOT NULL DEFAULT,
)

How do i present an aggregate query

inspection_id  |  meter_id  |  bay_use
1                 12345        (value of bay_1_use)
1                 12345        (value of bay_2_use)
1                 12345        (value of bay_3_use)
2                 23456        (value of bay_1_use)
2                 23456        (value of bay_2_use)
2                 23456        (value of bay_3_use)
2                 23456        (value of bay_4_use)
2                 23456        (value of bay_5_use)

Thanks



view thread (4+ messages)  latest in thread

Message-ID: <ddcb1c340705282132p656de07cy5618de275fc1f1f7@mail.gmail.com>
Permalink:  ../ddcb1c340705282132p656de07cy5618de275fc1f1f7@mail.gmail.com/
Also on:    postgresql.org/message-id/ddcb1c340705282132p656de07cy5618de275fc1f1f7@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: raj.ayappan@gmail.com
  Subject: Re: aggregate query
  In-Reply-To: <ddcb1c340705282132p656de07cy5618de275fc1f1f7@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