Dusan Kolesar wrote:
> 
> Hello mailing list,
> I have a table T:
> CREATE TABLE T
> (
>    RANGE_FROM Integer,
>    RANGE_TO   Integer,
>    DESC       Varchar(20)
> )
> //
> INSERT T (5, 8, Desc1)
> 
> I want to select from table T, but not just RANGE_FROM and RANGE_TO,
> but also numbers between.
> I need result :
> 5, Desc1
> 6, Desc1
> 7, Desc1
> 8, Desc1
> 
> Is it posible to generate numbers between some values?
> Thank you for your support.
> 
> Dusan
> 

There is no direct functionality available, but an idea may be:
Create a table nums
CREATE TABLE NUMS (N INT primary key)
Fill it with the values (1) ... whatever your maximum may be
And select like this
SELECT N, DESCR 
FROM T, NUMS
WHERE T.RANGE_FROM <= NUMS.N
  AND T.RANGE_TO   >= NUMS.N

Elke
SAP Labs Berlin

> --
> Dusan Kolesar
> Helsinska 19
> 040 13  Kosice
> Slovakia
> e-mail : [EMAIL PROTECTED]
> ICQ# : 160507424
> 
> 
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to