c# - finding string between two specified characters in Sql -
c# - finding string between two specified characters in Sql -
i have linkedin link in database column here have check linkedin id linked in link inserted 2 or more times. ex:https://www.linkedin.com/profile/view?id=246925795&authtype=name&authtoken=sygl&trk=prof-sb-browse_map-name
i have check id in database if id repeats 2 or more times must deleted , 1 must left. id=246925795
please help me
with ids ( select id, substring(linkedinlink, idstart, idend - idstart) linkedinid table cross apply ( select charindex('id=', linkedinlink) idstart ) ca1 cross apply ( select charindex('&', linkedinlink, idstart) idend ) ca2 ) ,duplicates ( select linkedinid ,max(id) lastduplicateid ids grouping linkedinid having count(*) > 1 ) delete table id in (select lastduplicateid duplicates)
c# asp.net sql sql-server sql-server-2008
Comments
Post a Comment