I have a table with data like this:
EmpID keyvaluePair
1 1111-1-4.JPG
2 4434-4-6.JPG
3 90899-4-3.JPG
4 8956-1-1.JPG
5 开发者_Python百科 67827-9-5.JPG
Now I need to modify the above table data and insert data into another table.
Here the value is nothing but the end value in keyvaluepair column:
ID Value
1 4
2 6
3 3
4 1
5 5
Hope my question is clear.
Can you help me out how to write a query to do the above operations
Thanks
Happysmile.
insert into SecondTable (ID, Value)
select EmpID, right(keyvaluePair,1) from FirstTable
INSERT INTO NewTable(ID, Value)
SELECT EmpID, right(keyvaluePair,1) FROM OldTable
精彩评论