Reputation: 21
TABLE Name: Issue_A
Key Ref_no
62939 Ng20
62940 Ng21
62944 Ng22
62946 Ng23
62949 Ng24
62951 Ng25
62952 Ng26
62953 Ng27
I want to insert 0 (zero) and update the table between 'Ng' and '20'
update Issue_A
set ref_no=REPLACE(SUBSTRING(ref_no,0, CHARINDEX('Ng', ref_no)),'H-','')))
where key in (62939,62940,62944,62946,62949,62951,62952,62953)
So the output will be 'Ng020'
and 'Ng021'
and so on
Upvotes: 0
Views: 52