Let's suppose I have my table named "say2" like the above.Code:say2 (n) title (1) Mom (2) WTD (3) SUN (4) Earth (5) Asia (6) Europe (7) Venus (8) Korea
The code1 below produces the result1 below.
And the code2 below produces the result2 below.Code:code1 SELECT n, title FROM say2 WHERE n=1 or n =3 or n =5 result1 (1) Mom (3) SUN (5) Asia
Let's UNION them like the below code3 and its result3.Code:code2 SELECT n, title FROM say2 WHERE n=5 or n =7 or n =8 result2 (5) Asia (7) Venus (8) Korea
Now I think It would be better if there is the opposite of UNION in mySQL.Code:code3 SELECT n, title FROM say2 WHERE n=1 or n =3 or n =5 UNION SELECT n, title FROM say2 WHERE n=5 or n =7 or n =8 result3 (1) Mom (3) SUN (5) Asia (7) Venus (8) Korea
UNION means result1 + result2.
I mean that the opposite of UNION means result1 - result2.
The following would-be code4 doesn't work correctly, but I hope it shows what I want.
Code:would-be code4 SELECT n, title FROM say2 WHERE n=1 or n =3 or n =5 the opposite of UNION SELECT n, title FROM say2 WHERE n=5 target result4 (1) Mom (3) SUN or would-be code5 SELECT n, title FROM say2 WHERE n=1 or n =3 or n =5 the opposite of UNION SELECT n, title FROM say2 WHERE n=5 or n =7 or n =8 target result5 (1) Mom (3) SUN



Reply With Quote
Bookmarks