Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Split two Columns data into range.

Author  Topic 

hspatil31
Posting Yak Master

182 Posts

Posted - 2012-05-21 : 02:36:52
Dear All,

In my table I have following table row data. I want to split Column5 and Column6 into range. Just like I mentioned in Desired Output.
Table row will deleted and range should be inserted into table.

Can anyone please tell me SQL statement for this ?

Table Row:

Column1 Column2 Column3 Column4 Column5 Column6
123 444 678 9876 0000 9999

Desired Output:

Column1 Column2 Column3 Column4 Column5 Column6
123 444 678 9876 0000 0999
123 444 678 9876 1000 1999
123 444 678 9876 2000 2999
123 444 678 9876 3000 3999
123 444 678 9876 4000 4999
123 444 678 9876 5000 5999
123 444 678 9876 6000 6999
123 444 678 9876 7000 7999
123 444 678 9876 8000 8999
123 444 678 9876 9000 9999





Thanks and Regard's
Harish Patil

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-21 : 04:06:32
what is your criteria for spiting ? increment of 999 ? 10 lines ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -