Current Path : /home/usr.opt/mysql57/mysql-test/suite/engines/funcs/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/engines/funcs/r/se_string_union.result |
DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 CHAR(1) NULL, c2 CHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARCHAR(1) NULL, c2 VARCHAR(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BINARY(1) NULL, c2 BINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 VARBINARY(1) NULL, c2 VARBINARY(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 BLOB(1) NULL, c2 BLOB(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2; CREATE TABLE t1(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); CREATE TABLE t2(c1 TEXT(1) NULL, c2 TEXT(1) NULL, c3 INT NULL); TRUNCATE TABLE t1; INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',1), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',3), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',2), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',7), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',7), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',7), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',7), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',6), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',6), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',6), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',6), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',4), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',5), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',5), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',5), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',5), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',9), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',9), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',9), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',9), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','a',8), ('a','a',2), ('a','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','a',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','a',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); INSERT INTO t1 (c1,c2,c3) VALUES ('a','b',8), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t1 (c1,c2,c3) VALUES ('b','b',1), ('b','a',8), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t1 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',8), ('c','d',9), ('c','f',5); TRUNCATE TABLE t2; INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',4), ('a','b',2), ('b','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',4), ('a','c',2), ('c','b',3), ('a','c',4), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',4), ('b','c',6), ('b','e',4), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',4), ('c','d',9), ('c','f',4); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',3), ('a','b',2), ('b','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',3), ('a','c',2), ('c','b',3), ('a','c',3), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',3), ('b','c',6), ('b','e',3), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',3), ('c','d',9), ('c','f',3); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',2), ('a','b',2), ('b','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',2), ('a','c',2), ('c','b',3), ('a','c',2), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',2), ('b','c',6), ('b','e',2), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',2), ('c','d',9), ('c','f',2); INSERT INTO t2 (c1,c2,c3) VALUES ('a','b',1), ('a','b',2), ('b','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','b',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','b',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); INSERT INTO t2 (c1,c2,c3) VALUES ('a','c',1), ('a','c',2), ('c','b',3), ('a','c',1), ('a','d',5); INSERT INTO t2 (c1,c2,c3) VALUES ('b','c',1), ('b','a',1), ('b','c',6), ('b','e',1), ('b','z',5); INSERT INTO t2 (c1,c2,c3) VALUES ('c','c',5), ('c','c',7), ('c','c',1), ('c','d',9), ('c','f',1); SELECT c1 FROM t1 UNION SELECT c1 FROM t2; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1='#C2' ; c1 SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c1 !='#C2' ; c1 a b c SELECT c1 FROM t1 WHERE c1='#C2' UNION SELECT c2 FROM t1 WHERE c1='#C2' UNION SELECT c1 FROM t2 WHERE c2 ='#C2' ; c1 DROP TABLE t1,t2;