About 10,300,000 results
Open links in new tab
  1. T-SQL Substring - Last 3 Characters - Stack Overflow

    Dec 2, 2011 · declare @newdata varchar(30) set @newdata='IDS_ENUM_Change_262147_190' select REVERSE(substring(reverse(@newdata),0,charindex('_',reverse(@newdata)))) === …

  2. SQL Server SUBSTRING() Function - W3Schools

    The SUBSTRING () function extracts some characters from a string. Required. The string to extract from. Required. The start position. The first position in string is 1. Required. The …

  3. help on substring (getting last 4 digits) - SQL Server Forums - SQLTeam.com

    Feb 4, 2012 · when substr(t2.paytype,1,4) = 'migs' then "credit card" else "otc" end) as tender_type, (case when substr(t2.paytype,1,4) = 'migs' then "bdo" else "dragon pay" end) as …

  4. SQL SUBSTRING Code Examples and Usage - SQL Server Tips

    May 10, 2023 · To extract only the file name (i.e., the part after the last backslash), you can use the SUBSTRING function along with the REVERSE function to return the position of the last …

  5. Extracting the Last Part of a String in SQL Server

    Jul 30, 2024 · Here’s the SQL query to extract the last part of the string: REVERSE(PARSENAME(REPLACE(REVERSE(column_name), '_', '.'), 1)) AS LastPart. …

  6. sql - How do I extract the last 4 digits of numerical value?

    Jun 28, 2021 · One more approach using SUBSTRING. DECLARE @table table(a varchar(30)) insert into @table values ('12345678') SELECT SUBSTRING(a,len(a) - 3, 4) from @table 5678

  7. How we get last 1-3 digit that is last number in URL in SQL server

    Oct 25, 2023 · it is clear, we need last digit after last '/' in URL, how we can extract last digit after '/'. please note number of digits do not fix it from 1 to N

  8. SUBSTRING, PATINDEX and CHARINDEX string functions in SQL

    Mar 1, 2021 · In this article, we explore SUBSTRING, PATINDEX, and CHARINDEX using examples. SUBSTRING function in SQL queries. The SUBSTRING() function extracts the …

  9. SQL Substring Funtion Explained with 4 Examples - Simplilearn

    Apr 17, 2025 · SUBSTRING() is a function that enables us to extract subparts of strings, which are known as substrings. The strings we want to extract from can be specified in the function …

  10. sql - How to take last four characters from a varchar ... - Stack Overflow

    Sep 20, 2012 · For Oracle SQL, SUBSTR(column_name, -# of characters requested) will extract last four characters for a given query. e.g. SELECT SUBSTR(description, -4) FROM …

  11. Some results have been removed
Refresh