SQL String Functions LEFT - RIGHT

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Syntax is:
LEFT ( string-expression , integer )
RIGHT ( string-expression , integer )

SELECT LEFT('Hello',2)  --return He  
SELECT RIGHT('Hello',2) --return lo

Oracle SQL doesn't have LEFT and RIGHT functions. They can be emulated with SUBSTR and LENGTH.
SUBSTR ( string-expression, 1, integer )
SUBSTR ( string-expression, length(string-expression)-integer+1, integer)

SELECT SUBSTR('Hello',1,2)  --return He  
SELECT SUBSTR('Hello',LENGTH('Hello')-2+1,2) --return lo


Got any SQL Question?