By using 8 string functions, we can extract 5 ways to get domain name from email column in SQL
SUBSTRING
CHARINDEX
PATINDEX
STUFF
LEFT
RIGHT
LEN
REVERSE
SUBSTRING(email,CHARINDEX('@',email)+1,LEN(email)) AS Domain_Name_SUBSTRING
,SUBSTRING(email,PATINDEX('%@%',email)+1,LEN(email)) AS Domain_Name_SUBSTRING
,STUFF(email,1,CHARINDEX('@',email),'')AS Domain_Name_STUFF
,REVERSE(LEFT(REVERSE(email),CHARINDEX('@',REVERSE(email))-1))AS Domain_Name_LEFT
,RIGHT(email,LEN(email) - CHARINDEX('@',email)) AS Domain_Name_RIGHT
On this page of the site you can watch the video online SQL SERVER||How many ways to get domain name from email column in a table? with a duration of hours minute second in good quality, which was uploaded by the user LearnSQLtoSSIS 03 January 2023, share the link with friends and acquaintances, this video has already been watched 224 times on youtube and it was liked by 5 viewers. Enjoy your viewing!