I'm new at SQL and I have been trying to practice working with Oracle Database.
While working on an activity, I came across one that confounds me -- I am trying to extract specific text from in-between characters. The specific activity that I cannot seem to figure out using these functions is:
For table called Users in the column called Emails, extract only the email domain (that is, the text in-between @ and .), so that full email addresses:
SELECT SUBSTR(Emails, INSTR(Emails, '@') + 1, INSTR(Emails, '.') - INSTR(Emails, '@') - 1) AS Domains FROM Users
I assume that emails have as single dot separating the domain name from domain type (e.g.
net). If you had an email like
firstname.lastname@example.org, then the above query would return
domain as being the domain.