In SQL Server you can use SUBSTRING
SELECT SUBSTRING('hello', 3, 1)
Take care: index is 1-based.
In Oracle, use SUBSTR
Syntax is SUBSTR(<string to parse>,<start position>,(<length>))
- i.e.
SELECT SUBSTR('hello',3,1)
Start position and length are one-, not zero-based. Zero is accepted, but will be interpreted as 1.
following Query will search from specific index for char and will return result
select * from tbPatientMaster
where SUBSTRING (fname,CHARINDEX ('.',fname,0)+1,LEN (fname)) like 'a%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With