From: Richard Huxton <dev@archonet.com>
To: Adam Witney <awitney@sghms.ac.uk>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: query or design question
Date: Mon, 20 Oct 2003 18:12:49 +0100
Message-ID: <200310201812.49869.dev@archonet.com> (raw)
In-Reply-To: <BBB97E48.26975%awitney@sghms.ac.uk>
References: <BBB97E48.26975%awitney@sghms.ac.uk>
On Monday 20 October 2003 11:58, Adam Witney wrote:
> Hi,
>
> I have a table like so
>
> CREATE TABLE imagene (
> id int
> bioassay_id int
> gene_id text
> s_row int
> s_column int
> s_meta_row int
> s_meta_column int
> sig_median numeric
> bkg_median numeric
> );
> And I need to generate an output like this......
>
> bioassay_id=106 bioassay_id=107
> ---------------------- ----------------------
> gene_id, sig_median, bkg_median, sig_median, bkg_median
> I am not sure if a crosstab function will do this?
There are some examples in contrib/tablefunc that might well be useful for
you. You should also check out the "Set Returning Functions" article on
http://techdocs.postgresql.org/
If you find your requirements getting particularly complex, I'd be tempted to
do the hard work in the application.
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, awitney@sghms.ac.uk
Subject: Re: query or design question
In-Reply-To: <200310201812.49869.dev@archonet.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