How do I do this
How can I SELECT rows with MAX(Column value), DISTINCT by another column in SQL?
but with a different table? Table A has the date and table C has the ID I want to be distinct.
Thanks.
How do I do this
How can I SELECT rows with MAX(Column value), DISTINCT by another column in SQL?
but with a different table? Table A has the date and table C has the ID I want to be distinct.
Thanks.
Use GROUP BY statement instead of distinct for this.
SELECT t1.a, MAX(t2.a)
FROM t1
JOIN t2
ON T1.id = t2.id
GROUP BY T1.a