MySQL [message #437037] |
Wed, 30 December 2009 07:57 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tejas.patel
Messages: 22 Registered: December 2008 Location: NJ
|
Junior Member |
![yes](/forum/theme/orafaq/images/yahoo.png)
|
|
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 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68675 Registered: March 2007 Location: Nanterre, France, http://...
|
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
|
|
|
|
|
|
|
|