I gang

SQL Guru needed

Hi,

I have a MySQL table with ca. 2.5 million records structures this way:

NAME DATE PRICE AMOUNT MA_PRICE SPECIAL

There are ca 3000 different values for NAME in the table. Each of them has prices for every business day during the last 3 years.

1. Moving Average

-------------------------------------------------------------

I need the MOVING AVRG of each name to be calculated and inserted in the field MA_PRICE.

Example:

Find for each NAME the record for today. Calculate the AVRG price for the last 100 days (Today - 100 days) and insert it in the Field MA_PRICE.

Do the same with yesterday. And the day before yesterday. And so on.

2. Special Formula

-----------------------------

I have a special formula in which I take the prices of the last x days do a calculation with it and store it in the Field SPECIAL. I will provide the formula. (If you can do No. 1. you can do this too.)

Færdigheder: Perl, PHP, XML

Se mere: to guru, the guru, sql price, in guru, i guru, find guru, a guru, on sql, sql mysql, sql guru, sql business, insert date, calculate different, sql different, php mysql sql example, last days sql, date calculation, insert mysql table, table perl, perl table, insert sql, price formula, php calculate date, calculate average, perl date

Om arbejdsgiveren:
( 1 bedømmelse ) Montevideo, Uruguay

Projekt-ID: #275198