"Martin Szabo" <[EMAIL PROTECTED]> wrote: > I've tried to find a way to generate a list of consecutive numbers with a > SELECT statement. > I would like something like "Select ..." that would result the numbers > between 1 and 20 on separate rows. > > So far, the only solution I have found is to have a table with consecutive > numbers from 1 to 1000, and then I can just select the range I want from > that table.
Not exactly what you are looking for, but you can use SQL variables in a manner like: SET @a=1; SELECT @a:[EMAIL PROTECTED],@a:[EMAIL PROTECTED] ... in that case you can use the "@a:[EMAIL PROTECTED]" construct in your SQL statement and the result value will be incremented by one each time it is retrieved. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]