Can someone please help with the below?
DELL 2009xftp DM0F532H7161888I793M NEW JERSEY
) Current sample data in the description
column:
Firstname.Lastname DELL 2009xftp DM0F532H7161888I793M NEW JERSEY
All 64k records have the same pattern like above.
if your data has the Firstname.Lastname and there are no spaces in the Firstname.Lastname then you can use CHARINDEX()
, LEN()
and RIGHT()
declare @var as varchar(50)
set @var = 'Firstname.Lastname DELL 2009xftp DM0F532H7161888I793M NEW JERSEY'
select charindex(' ',@var) --returns where the first space is; returns 19
select len(@var) --returns the length of the string; returns 50
select right(@var,(len(@var)-charindex(' ',@var)))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.