I have a query which finds Customers( Companies) in the Customer Table and links to the COntact file which has contacts and email addresses. (There are no email addresses or domain names in the Customer table.)
I would like to strip out the domain names from the email addresses to create a report of Customer and domain name.
Need some help.
I have the query producing the Customers and Contact email address, just not sure how to strip it down to the domain.
MySQL offers the substring_index() function which serves the same purpose as the Oracle instr() function. SQL Server offers charindex(), Teradata gives us position()… most databases will offer some way to look inside of a string and find a character or other string and its position.
You don’t need to provide the length of the string, if you leave it out the substr() function operates from the starting position you gave it and goes to the end of the string.