Re: Add calculated fields from one table to other table - Mailing list pgsql-sql

From chester c young
Subject Re: Add calculated fields from one table to other table
Date
Msg-id 20061026152900.21557.qmail@web54305.mail.yahoo.com
Whole thread Raw
In response to Add calculated fields from one table to other table  (roopa perumalraja <roopabenzer@yahoo.com>)
List pgsql-sql
roopa perumalraja <roopabenzer@yahoo.com> wrote:
Hi
 
I have two tables. Tick table has fields like ticker, time, price & volume and Timeseries table has fields like ticker, time, avg_price, avg_volume.
 
The time field in Timeseries table is different from time in tick table, its the timeseries for every minute. Now I want to calculate the average price & volume from tick table for each ticker and for every minute and add those fields to timeseries table. Can anyone please help me out with the sql query.
 
Note: The ticker in the tick table also has duplicate values, so i am not able to create relation between two tables.
 
Thanks in advance
Roopa

You can't get there from here.  It is like saying a hitter has a .250 average and in this game he was 2 for 4, what's his average?  Timeseries must also have quantity and price, just as you would need to know number of bats and hits for the baseball player.


Want to be your own boss? Learn how on Yahoo! Small Business.

pgsql-sql by date:

Previous
From: "Jon Horsman"
Date:
Subject: Re: How to query information schema from shell script
Next
From: Michael Fuhr
Date:
Subject: Re: not able to execute query on spatial database.