I have been trying to use 'user variables' to keep track of the previous row for use in a calculation of the present row. Is there a way I can do this? Or is there a better way in trying to use a previous rows value in the present row.
For example; SELECT number as current_day, (number - <prevnumber>) as change_from_prev_day FROM TABLE ORDER BY DATE <prevnumber> is the reference that I need from the previous row. Am I missing something simple or do I have to do this outside of MYSQL? Any help would be appreciated. thanks, jasmin. __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php