I need to write a SQL function that will allow me to strip an email address to the bare domain name. EX: I would make [email protected] read as [email protected]. This is most likely very simple but, I cannot seem to find any information on it.
A:
If you are using Oracle:
select substr('[email protected]',instr('[email protected]','@')+1,length('[email protected]')) as domain from dual;
Sammy Boy
2010-08-18 18:18:11