Jump to content

Matching Two Table(s) To Isolate Or Remove Duplicacy


anggwaponi
 Share

Recommended Posts

hello all :) i would like to inquire or ask an assistance how to queries two (2) tables with the same number of fields, as well, the same header (did i say the right word) but has different contents?its like table GardenA and GardenB ... the main query i would like to acquire is the column name emailaddress.i want to find out if the email addresses in GardenA is not present in GardenB ...it just happened that i want to send an email to those email addresses that has not yet been send yet (even once) any messages in both tables.hope i can be enlighten :(Sad cheers! :)

Link to comment
Share on other sites

SELECT emailaddressFROM GardenAUNION SELECT emailaddressFROM GardenB

The UNION command automatically excludes duplicates

hello Dad Deirdre and good day once again :) is the command or syntax u gave only shows the result by way of comparing the two tables without altering or changing the table? sorry to ask but i'm a little bit worried of the word UNION between the line since it might affect the whole table.i just want to make a query and not to change. and i don't want my colleagues to be mad at me since i have done sumfing on it (hope u understand what i mean) :) cheers! :)
Link to comment
Share on other sites

Correct. You are safe. UNION connects results, not data.But if you have any doubts, do what I always do. Create some temporary tables and test your commands on them. You should be doing this already. :)
thanks Dad Deirdre :) i'm alwys glad that their's a forum like here in w3schools since it surely helps a lot.happy weekend guys :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...