I have strings in a database like this:
And I only need the characters that appear before the @ symbol.
I am trying to find a simple way to do this in SQL.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
If you need to get the value before the @ character, you'll need to use something like:
SELECT LEFT(Email, CHARINDEX('@',Email)-1) FIELD_ALIAS FROM YOUR_DE
FIELD_ALIAS with the name of the field where you want to store this value. Also, replace
CHARINDEX('@',Email) will return the index of the @ character. And since we don't want to get this character, we need to substract 1 from it.
LEFT will return all characters to the left of the @ character.