I have a view with select query with join.
SELECT
t.a,
t.b,
(SELECT CASE WHEN t2.field IS NULL THEN 0 ELSE 1 END AS Expr1) AS C
FROM table1 t1
LEFT JOIN table2 t2 on t2.link = t1.link
If in table2 there is more than 1 entry with same link, i’m getting duplicated entries.
What is the correct way to distinct result? Is there a type of JOIN, that won’t return all result, but only single row?
Thank you
If they are really duplicates, if you use distinct they are removed: