How to extract the last name from [email protected] using Oracle?
Posted
by Simpson
on Stack Overflow
See other posts from Stack Overflow
or by Simpson
Published on 2010-03-26T22:03:56Z
Indexed on
2010/03/26
22:53 UTC
Read the original article
Hit count: 266
Oracle
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!
© Stack Overflow or respective owner