I have two columns of coaches names:
coach1
JOHN
JACOB
MARY
coach2
JOHN
JAC开发者_运维问答OB
HENRY
I would like to select all DISTINCT values between the two columns.
So that my SELECT statement will read,
JOHN
JACOB
MARY
HENRY
with no duplicates. Any suggestions as to the most efficient way to do this?
SELECT COACH1 AS NAME FROM TABLE UNION SELECT COACH2 AS NAME FROM TABLE
Is a way to do. I'm not saying it's the "most" efficient to do, though :) Shouldn't be too bad. UNION
by default will select only distinct values.
精彩评论