Thanks for the question, sona.
Asked: June 06, 2016 - 6:45 am UTC
Last updated: July 03, 2018 - 12:37 am UTC
Version: oracle 10.1.2
Viewed 10K+ times! This question is
substr(email, 1, instr(email, '@')-1)
create table t ( email varchar2(20) ); insert into t values ('xyz@gmail.com'); insert into t values ('xyz@gmail.co.in'); insert into t values ('xyzef@gmail.com'); select * from ( select email, substr(email, 1, instr(email, '@')-1) local_part, count(*) over ( partition by substr(email, 1, instr(email, '@')-1) ) ct from t ) where ct > 1; EMAIL LOCAL_PART CT -------------------- ---------- ---------- xyz@gmail.com xyz 2 xyz@gmail.co.in xyz 2
sona sh, June 06, 2016 - 10:39 am UTC
A reader, July 01, 2018 - 9:26 am UTC
Analytic SQL got you confused? Check out Connor McDonald's complete video course.