WebMay 16, 2011 · Declare @mySQL Varchar (100) Set @mySQL = 'Hello *Can anyone help me' Select Substring (@mySQL, PATINDEX ('%*%', @mySQL) + 1, LEN (@mySQL)) --or Select Substring (@mySQL, CharIndex ('*', @mySQL) + 1, LEN (@mySQL)) Best Wishes, Arbi --- MCC 2011; Please vote if you find this posting was helpful or Mark it as answered. WebCode language: SQL (Structured Query Language) (sql) First, specify the trim_character, which is the character that the TRIM function will remove. If you do not specify trim_character the TRIM function will remove the blank spaces from the source string. Second, place the source_string followed the FROM clause.
SQL Remove Characters from String with Examples [SOLVED]
WebExample-1: SQL remove characters from string right after character To remove characters right after the specified character we first need to find an index of the specified character using the CHARINDEX () function into a given string and then extract left remaining characters from the string using the LEFT () function Web2 days ago · 1 Answer Sorted by: 0 Try this create table test (id int,keys varchar (100)); insert into test values (1,'Sh/cm/rq') , (2,'Sh/nj/mdr/wep') , (3,'Sh/kl/uhj/tyu bh/red') ; select * ,case when charindex ('/',keys)>0 then reverse ( substring (reverse (keys),charindex ('/',reverse (keys))+1,100) ) else keys end newkeys from test Share china scenery wallpaper hd
oracle - how to use substring with a delimiter - Database ...
WebOct 22, 2024 · Here we will see SQL statements to remove part of the string. Method 1: Using SUBSTRING () and LEN () function We will use this method if we want to remove a part of the string whose position is known to us. 1. SUBSTRING (): This function is used to find a sub-string from the string from the given position. It takes three parameters: WebMar 1, 2024 · SQL Server provides many useful functions such as ASCII, CHAR, CHARINDEX, CONCAT, CONCAT_WS, REPLACE, STRING_AGG, UNICODE, UPPER for this purpose. In … WebAug 16, 2016 · SQL Select everything after character Ask Question Asked 6 years, 7 months ago Modified 1 month ago Viewed 128k times 36 I'd like to select everything AFTER a certain character (-) that is placed on the most right side. Eg. abcd-efgh-XXXX And I'd like to … china scented soy wax candles in jars