I have a table as:
table1(id int, count int)
Now I want to get a result that contains table1's id and a increment number column from one to count. For example,table1 has two rows of data:
id count 1 3 2 4
then result should be
id nr
1 1
1 2
1 3
2 1
2 2
2 3
2 4
How can I do it with PostgreSQL or SQL Sever?