[RESOLVED] Sql Problem
I currently have the following SQL Statement:
select c.Id, c.name, c.active, a.name as attribute
from component as c join attribute as a on c.attributeid = a.id
order by c.name asc
this gives me data in the form:
183 Communal Enclosure 1 Cleaning
150 Composite 1 Doors Generally
21 Composite 1 Windows
33 Composite 1 Doors Generally
36 Door Frame 1 Doors Generally
46 Door Frame 1 Doors Communal
154 Door Frame 1 Doors Generally
The problem is that I have duplicates of columns c.name and a.name with different Id's
I want to list distinct based on these 2 columns and furthermore want only the row with the highest id on duplicates returned. How should the Select statement be changed? It can be a stored proc.
Thanks.

