I have a table named "test" with 4 columns:
+------+------+------+------+
| num | info | name1 | name2 |
+------+------+------+------+
And I want a DISTINCT list of the names from "name1" and "name2" (some of the same names may appear in either column, or may be blank).
I can easily get the DISTINCT listing of each column:
SELECT DISTINCT name1 FROM test;
and
SELECT DISTINCT name2 FROM test;
But I do not know how to JOIN them together into one DISTINCT result.
I am a MySQL novice, and am struggling with JOINing stuff together. Any help is greatly appreciated.
Thanks in advance.
+------+------+------+------+
| num | info | name1 | name2 |
+------+------+------+------+
And I want a DISTINCT list of the names from "name1" and "name2" (some of the same names may appear in either column, or may be blank).
I can easily get the DISTINCT listing of each column:
SELECT DISTINCT name1 FROM test;
and
SELECT DISTINCT name2 FROM test;
But I do not know how to JOIN them together into one DISTINCT result.
I am a MySQL novice, and am struggling with JOINing stuff together. Any help is greatly appreciated.
Thanks in advance.