hi i have a question in getting values from two table i ave two tables Table1 and Table2. table 1 have data and table 2 may have the same data as table 1 and more. and also table 1 may have the same data and some which is not in table2 and vise versa.
so what i want to do is to the the unique values in table1 and table2 and the intersecting values to a query. depending on the ID both the tables have the id andm title,email
how can i do this i tried to do in join but the intersecting data is displayed twice, how can i get it to display onces

aprriciate if you can help me
thanxx

If your SQL Server is 2005 or greater, you can use EXCEPT and INTERSECT to find these.
List email addresses that are in both Table1 and Table2:

SELECT email FROM Table1
INTERSECT
SELECT email FROM Table2

List email addresses that are in Table1 but not in Table2:

SELECT email FROM Table1
EXCEPT
SELECT email FROM Table2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.