pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Connelly@South Central <Mark.Connelly@ntl.com>
To: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: using Avg()
Date: Thu, 27 Feb 2003 16:59:26 -0000
Message-ID: <685AD5FCEB6BD5119A3A0008C7DB50510515D04A@MAST-WI0-SE01> (raw)

I have a table with a column named SwErr   (Switch Error) with int values
date with datetime values and SwID with char(3)
I am trying to get a subset back where the folowing is true
 
select the avg(SwErr) for the last 30 days where SwId = 'XX1'
Select the value of todays value of SwErr where SwId = 'XX1'
if todays value of SwErr is greater than 4 times the SwErr Average return in
the value
 
TIA
 
Mark Connelly
 
 
 
 
 


The contents of this email and any attachments are sent for the personal attention
of the addressee(s) only and may be confidential.  If you are not the intended
addressee, any use, disclosure or copying of this email and any attachments is
unauthorised - please notify the sender by return and delete the message.  Any
representations or commitments expressed in this email are subject to contract.
  
ntl Group Limited




view thread (2+ messages)  latest in thread

Message-ID: <685AD5FCEB6BD5119A3A0008C7DB50510515D04A@MAST-WI0-SE01>
Permalink:  ../685AD5FCEB6BD5119A3A0008C7DB50510515D04A@MAST-WI0-SE01/
Also on:    postgresql.org/message-id/685AD5FCEB6BD5119A3A0008C7DB50510515D04A@MAST-WI0-SE01

 · 

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 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: Mark.Connelly@ntl.com
  Subject: Re: using Avg()
  In-Reply-To: <685AD5FCEB6BD5119A3A0008C7DB50510515D04A@MAST-WI0-SE01>
  References: <685AD5FCEB6BD5119A3A0008C7DB50510515D04A@MAST-WI0-SE01>

* 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