Right Substring in SQL Server

telldurges
 
on Mar 10, 2021 10:34 PM
468 Views

Hello Team,

I want right substring from sql how can i get the result

Example i have a string 'ABCDEFGHIJK'

I WANT FROM RIGHT ' EFG ' HOW CAN I GET 

its dynamic like substring we give (length,start,position)

like this i want from right we can give dynamic number from right.

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Mar 11, 2021 03:19 AM

Hi telldurges,

Use REVERSE function.

SQL

SELECT REVERSE(SUBSTRING(REVERSE('ABCDEFGHIJKL'),6,3))

Output

EFG