1.11M Members

Help for mysql Join

 
0
 

Hello !!

I need help fot the following situation:

I have 2 tables: test1 and test2:
each one have the same columns name: data
test1:
column data

values (black, white)

test2:
column data
values(white,black,orange, yellow)

what sql sentence i can use to show only the values (orange, yellow) the difference between the 2 tables?

 
0
 

Are you looking for this?

SELECT * FROM test1, test2 WHERE test1.data!=test2.data
 
0
 

Try this

SELECT test1.data FROM test1 JOIN test2 ON test1.data!=test2.data
 
0
 

Thanks to everyone for replying to my questions!

All seems to work fine.

but particulary i have tried this one:

SELECT DISTINCT test1.data
FROM test1.data
WHERE (test1.data) NOT IN
(SELECT test2.data FROM test2)

it´s a bit more flexible.

Question Answered as of 2 Years Ago by mwasif and anand01
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: