Hi, Fellows! Sorry for my poor english. Thats why I can explain myself properly. :- )
What I really want is a calculate column with consecutive numbers from <n> to <m>, where <n> can be any number, and <m> depending on the result of the WHERE clause. I need to print pay orders for students, this pay orders use a consecutive control number, the criteria to select students use to be variable. Example: SELECT <colnum>, id, name FROM students WHERE status='OK' (4 rows selected) or SELECT <colnum>, id, name FROM students WHERE grade=1 (230 rows selected) <colnum> must be the same number that is printed in the pay order. The next pay order on the printer is 15000, then <colnum> of the first row of the SELECT must be 15100, the next row 15001, and so on. you get it? I remember that the sample i saw in this SQL list only used a SELECT statement without a table, or whitout a memory variable. it was only a SELECT <something>, and it returns a consecutive serie from 1 to 100. Thanks again. ______________________________________ José Angel Blanco Linares Depto Servicios de Apoyo Académico Centro de Enseñanza Técnica Industrial 3641-3250, ext: 266 --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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