while((r_status=_sql_fetchrow(&table_help,&r_timestamp,&r_value,derive))>0) {
/* processing of value */
/* calculate index for the timestamp */
while((r_status=_sql_fetchrow(&table_help,&r_timestamp,&r_value,derive))>0) {
/* processing of value */
/* calculate index for the timestamp */