hello there,

Is there a way to select an increment function so it returns an index
which is increemented by one for each row and that could be used to do
some calculations with other fields?

Example:

select incr() as INDE, date_add(date_col, interval (INDE-1)*7 day)
     from suchtable
where date_col >= '2001-02-27';

I can workaround by selecting columns/rows into an empty table with an
auto_increment column and then do the calculations there but this is not
quite ideal.

cheers,
        Zac

sql,query


---------------------------------------------------------------------
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

Reply via email to