Finding strange patters - Mailing list pgsql-sql

From Richi Plana
Subject Finding strange patters
Date
Msg-id Pine.LNX.4.04.9904010852380.12452-100000@jaguar.mozcom.com
Whole thread Raw
List pgsql-sql
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/




pgsql-sql by date:

Previous
From: "Jackson, DeJuan"
Date:
Subject: RE: [SQL] Retrieving the record not matched with a join.
Next
From: "Robert Chalmers"
Date:
Subject: How do I return values that begin with non-alphabet characters from a search?