sql - Using SubString when not knowing position or length -
Can someone help me as I need to remove the number after "code =" reference = "? It is not possible to know the number of characters before or after the number as well as the number of length (can also be letters and numbers), but it is always
The string is from a table with a large amount of rows and I must include the reference of each row in another table SQL Server MySQL "Reference =" first ", description"
object = CTSENORaanG, reference = 0000021357, description = test, currency = EUR, Initial_Date = 15Aug2011 ....
declare @str varchar (1000) set @ Str = 'object = ctsnorang, reference = 0000021357, description = test, currency = EUR, Initial_Date = 15Aug2011 ....'; Select from substring (col, 1, charindex (',', col) -1) (select substring (@ str, charindex ('references =', @ str) +10,100);;
set @str: = 'object = ctsnorang, reference = 0000021357, description = test, currency = EUR, Initial_Date = 15Aug2011 ....'; Substring (Col, 1) Select (from ',', cola) -1) (substring (@ str, find out ('reference =', @ str) +10,100);;
Comments
Post a Comment