How to substring the following
-
I have an email addresses from different employee and I only want to get the character before the @ sign, how can we do it in SQL? I have tried the substring but it didnt work since the length of email add varies. ex. MSantos@yahoo.com CSanBeda@hotmail.com Aaloya@gmail.com I want to get the character before @ sign result should be MSantos CSanBeda Aaloya Thanks
Dabsukol
-
I have an email addresses from different employee and I only want to get the character before the @ sign, how can we do it in SQL? I have tried the substring but it didnt work since the length of email add varies. ex. MSantos@yahoo.com CSanBeda@hotmail.com Aaloya@gmail.com I want to get the character before @ sign result should be MSantos CSanBeda Aaloya Thanks
Dabsukol
-
I have an email addresses from different employee and I only want to get the character before the @ sign, how can we do it in SQL? I have tried the substring but it didnt work since the length of email add varies. ex. MSantos@yahoo.com CSanBeda@hotmail.com Aaloya@gmail.com I want to get the character before @ sign result should be MSantos CSanBeda Aaloya Thanks
Dabsukol
select substring(columnname, 1, charindex('@', columnname) - 1) from tablename
Do good and have good.