MySQL [message #437037] |
Wed, 30 December 2009 07:57 |
tejas.patel
Messages: 22 Registered: December 2008 Location: NJ
|
Junior Member |
|
|
how to print 1 to n using dual table in MYSQL.
format Column print
thanks in advance..
reply me.
|
|
|
Re: MySQL [message #437039 is a reply to message #437037] |
Wed, 30 December 2009 07:59 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
This is an Oracle forum. You may be better served on a MySql forum. However, I am sure someone here will probably know the answer.
|
|
|
Re: MySQL [message #437045 is a reply to message #437037] |
Wed, 30 December 2009 08:32 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
There is no DUAL table in MySQL.
You can do it with the following recursive query (also available in Oracle from 11gR2 adding FROM DUAL in the first part of union):
WITH
row(nb) AS (
SELECT 1
UNION ALL
SELECT nb + 1 FROM row WHERE nb < n
)
SELECT * FROM row
Regards
Michel
[Updated on: Wed, 30 December 2009 08:33] Report message to a moderator
|
|
|
|
|
|
|
|