Is there a better way to get all distinct values from three columns in one table other than using the DISTINCT function? I've also tried GROUP BY
, but there doesn't seem to be any noticeable difference in the cost.
SELECT DISTINCT Table1.Col1, Table2.Col1, Table1.Col3
FROM Table1
INNER JOIN Table2 ON Table1.FK = Table2.ID
WHERE Table1.Foo = 1865 AND Table2.Type = 1