Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 21st, 2003, 02:42 AM
Registered User
 
Join Date: Nov 2003
Location: , , Canada.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 7Day Moving Average

:):):):)

Good Day,

I wonder if anyone could advise me on this. My statistical Oracle DB stores hourly values only, so a Query for a Metric(C1055) Daily value looks like this:
SELECT
  CGSP.DW_STAT_CELL_DIM.CELL_NAME,
  CGSP.DW_DATE_DIM.EVENT_DATE,
  SUM(CGSP.DW_NORTEL_CELL_FACTS.C1055)
FROM
  CGSP.DW_STAT_CELL_DIM,
  CGSP.DW_DATE_DIM,
  CGSP.DW_NORTEL_CELL_FACTS
WHERE
  ( CGSP.DW_STAT_CELL_DIM.CELL_KEY=CGSP.DW_NORTEL_CELL _FACTS.CELL_KEY )
  AND ( CGSP.DW_DATE_DIM.DATE_KEY=CGSP.DW_NORTEL_CELL_FACT S.DATE_KEY )
  AND (
  CGSP.DW_STAT_CELL_DIM.CELL_NAME = 'CXC012'
  AND CGSP.DW_DATE_DIM.EVENT_DATE = {d '2003-11-14'}
  )
GROUP BY
CGSP.DW_STAT_CELL_DIM.CELL_NAME,
CGSP.DW_DATE_DIM.EVENT_DATE

The Question: How to modify this to obtain one extra column showing a "Moving 7 Day Average" for C1055

whith a condition such as: EVENT_DATE BETWEEN SYSDATE-12 AND SYSDATE-5, for example.

Please help,

Gezza



N/A
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining the average of multiple rows into one Saidar SQL Server 2005 2 December 24th, 2007 03:45 AM
Getting an average using SQL vs VBScript mat41 Classic ASP Professional 1 November 1st, 2007 06:33 PM
How to average a series of integers using assembly smithyluke Assembly Language 0 October 9th, 2007 12:42 AM
Find average for values stored in an array ja8261 VB.NET 2002/2003 Basics 2 October 29th, 2004 10:05 AM
find the average value from a column of values codespike Classic ASP Basics 2 August 15th, 2003 07:37 AM



All times are GMT -4. The time now is 08:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.