So i have Table and i have Columns NumberMin(minimal number ) and i have NumberMax(maximal number) i have many records i want to select all data and in new column i had numbers beetwen this number min and number max like this this is table
ID Name NumberMin NumberMax
13 Jhon 10 14
and when i select i want to be like this
Name NumberMin NumberMax newcolum
Jhon 10 14 10
Jhon 10 14 11
Jhon 10 14 12
Jhon 10 14 13
i tried this code but didn't worked like this
;with numcte
AS
(
SELECT NumbMin as[SEQUENCE]
UNION all
SELECT Name,NumbMin,NumbMax,[SEQUENCE] + 1 FROM Table WHERE NumbMin <NumbMax
)
SELECT * FROM numcte