Skip to content
Advertisement

Wildcard for string before @ character

How would I use a wildcard to filter out any permutation of the following. There can be any number of zeros before the “@” character. Example

Basically, I’m looking to wildcard any email address with only zeros before the @ character.

Any help would be greatly appreciated Thank you !

Smiddy

Advertisement

Answer

T-SQL:

To remove all values with only zeros before the @

— LEFT & CHARINDEX : get the result LEFT of the @
— LEN & REPLACE : After all 0 are replaced by ” any email that contained only zeros will result in len = 0.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement