How to extract the last name from [email protected] using Oracle?
- by Simpson
Hello - I know this can't be too difficult, but I've tried everything I can think of and cannot get it to work. I need to compare the value of a column (LASTNAME) with a system variable (:VARIABLE), but the variable is an email address, so I need to trim off the "@email.com" and "firstname." Some things I've tried:
select * from TABLENAME where LASTNAME LIKE :VARIABLE
select * from TABLENAME where LASTNAME IN :VARIABLE
I've been able to trim off the @email.com, can't figure out how to trim off FIRSTNAME. at the same time.
Thanks!