Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql comparison
Message
De
10/02/2017 07:48:21
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Sql comparison
Divers
Thread ID:
01647831
Message ID:
01647831
Vues:
60
HI

I am trying to join two tables in a query based on the domain name in the email

so I have
select * from account a
JOIN contact c
ON
right(c.[EMailAddress1], charindex('@', reverse(c.[EMailAddress1]))-1)  = right(a.[EMailAddress1], charindex('@', reverse(a.[EMailAddress1]))-1)
which gives me the domain name in both emails.

but when I run the query I get a failure when an email address has no @ sign ( few are empty)

any idea whats the best way to deal with that in the query join.

Thanks

Nick Mason
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform