SQL>
SQL> CREATE TABLE email (e VARCHAR(50));
Table created.
SQL> INSERT INTO email VALUES ('I@napier.ac.uk');
1 row created.
SQL> INSERT INTO email VALUES ('P.Bhardwaj@napier.ac.uk');
1 row created.
SQL> INSERT INTO email VALUES ('Scott@rbs.co.uk');
1 row created.
SQL> INSERT INTO email VALUES ('Alan@rbs.co.uk');
1 row created.
SQL> INSERT INTO email VALUES ('abc@s.com');
1 row created.
SQL>
SQL> SELECT SUBSTR(e,1+INSTR(e,'.',-1)),e
2 FROM email;
SUBSTR(E,1+INSTR(E,'.',-1))
--------------------------------------------------
E
--------------------------------------------------
uk
I@napier.ac.uk
uk
P.Bhardwaj@napier.ac.uk
uk
Scott@rbs.co.uk
SUBSTR(E,1+INSTR(E,'.',-1))
--------------------------------------------------
E
--------------------------------------------------
uk
Alan@rbs.co.uk
com
abc@s.com
SQL>
SQL> DROP TABLE email;
Table dropped.
SQL>
|