From: Richi Plana <richip@mozcom.com>
To: pgsql-sql@hub.org
Subject: Finding strange patters
Date: Thu, 1 Apr 1999 08:57:54 +0800 (JST)
Message-ID: <Pine.LNX.4.04.9904010852380.12452-100000@jaguar.mozcom.com> (raw)
Hi,
Given a table A(name char(20), value float), is it possible to select a
tuples whose value varies by a certain amount from the average of all
values with same names? ie.
SELECT name AS tempname, value FROM A WHERE value/(SELECT AVG(value) FROM
A WHERE name = tempname) > 0.75;
L L Richi Plana 8^) ,-,-. ,-,-. ,-,-. ,-,-. ,-
LL LL Systems Administrator / / \ \ / / \ \ / / \ \ / / \ \ / /
LLLLL Mosaic Communications, Inc. \ \ / / \ \ / / \ \ / / \ \ / /
LLLLL mailto:richip@mozcom.com `-'-' `-'-' `-'-' `-'-'
------------------------------------------------------------------------
P G P Key available at http://www2.mozcom.com/~richip/richip.asc
Tired of Spam? Join this CAUCE! http://www.cauce.org/
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: richip@mozcom.com, pgsql-sql@hub.org
Subject: Re: Finding strange patters
In-Reply-To: <Pine.LNX.4.04.9904010852380.12452-100000@jaguar.mozcom.com>
References: <Pine.LNX.4.04.9904010852380.12452-100000@jaguar.mozcom.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