grouping 2007-11-02 - By Octavian Rasnita
Back Hi,
I have a table with the following columns:
symbol date value
I want to select all the symbols (grouping by symbols) between 2 specified dates, and calculate the percent of change for each symbol.
The percent of change is (the value from the last date of the symbol - the value from the first date) / the value from the first date.
For example I have:
SMB1, 2007-01-01, 1000 SMB1, 2007-03-15, 2100 SMB1, 2007-10-10, 1300 ... (other symbols)
And the result of the select should be: SMB1, 0.3
Is it possible to do this with an MySQL query?
Thank you.
Octavian
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=mysql@(protected)
|
|