I have this table, I am trying to figure out a way to get the unique values from both the columns.
CREATE TABLE `test` (
id bigint(20) NOT NULL,
col1 varchar(256) NOT NULL,
col2 varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `test` ADD PRIMARY KEY (`id`);
ALTER TABLE `test` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
INSERT INTO `test` (`col1`,`col2`) VALUES ('A', 'B');
INSERT INTO `test` (`col1`,`col2`) VALUES ('A', 'C');
INSERT INTO `test` (`col1`,`col2`) VALUES ('A', 'D');
INSERT INTO `test` (`col1`,`col2`) VALUES ('B', 'D');
INSERT INTO `test` (`col1`,`col2`) VALUES ('B', 'E');
INSERT INTO `test` (`col1`,`col2`) VALUES ('C', 'F');
EXPECTED RESULT:
A
B
C
D
E
F