Received: from copycat.mozcom.com ([205.136.46.9]) by hub.org (8.9.2/8.9.1) with ESMTP id TAA56736 for ; Wed, 31 Mar 1999 19:57:55 -0500 (EST) (envelope-from richip@mozcom.com) Received: from jaguar (jaguar.mozcom.com [202.47.132.75]) by copycat.mozcom.com (8.9.3/8.9.3) with ESMTP id IAA23958 for ; Thu, 1 Apr 1999 08:57:53 +0800 (HKT) Date: Thu, 1 Apr 1999 08:57:54 +0800 (JST) From: Richi Plana To: pgsql-sql@hub.org Subject: Finding strange patters Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/