Jump to content

Recommended Posts

Posted

Hey guys...I've got a question for ya.

 

I'm trying to create a suppression process so I can then create a list of people i want to email. So far I have 2 tables. Table A contains email addresses and another field I call suppression_type (this field will get it's value based on different types of suppression that i do). Table B contains a running lists of people that opt not to receive an email. Anyways, basically I'm running a query that matches on email addresses and then updates the suppression_type field in table A.

 

I am currently doing this using a sub query that looks like this:

 

>update TableA
set suppression_type = 1
where rtrim(ltrim(Email) in (select ltrim(rtrim(Email)) from TableB)
and suppression_type is null

 

I tried running counts using this sub query and then using another query that has an inner join (should do the same thing right?). I noticed that the counts were higher using an inner join. Here's the query I ran:

 

>select count(*)
from TableA as A
inner join	
TableB as B on
A.Email = B.Email
Where A.suppression_type is null

 

Can anyone explain the difference between these two and why they would be off? :)

 

Thanks so much for your help!

 

-Sam

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...