im using SQL SERVER 2008 R2 I have an LV table with structure identifier (varchar), name (varchar) and Item (int)
ID Name Item
1 xxx 5
2 yyy 9
3 rrr 11
4 hhh 19
I want to insert LV_TEMP into the table with the same structure, but with the condition when Item> 9, then I have to split 9
what is the expected table LV_TEMP
ID Name Item
1 xxx 5
2 yyy 9
31 rrr 9
32 rrr 2
41 hhh 9
42 hhh 9
43 hhh 1
how can I do this in SQL, I did in C # with the modulo operator (%) 9
thank you in advance
source
share