either of the above two solutions will give you distinct names
however, if you want any other column data to go along with the distinct names, then you will need something else
for example, if you want ResourceTypeID as well, then you have to have a rule to determinie which ResourceTypeID value you want for each name
here's an example to get the highest ResourceTypeID for each name --
Code:
select max(ResourceTypeID) as maxResourceTypeID
, Name
from yourtable
group
by Name
but now if you also want the ID that goes along with the highest ResourceTypeID, it gets even more complicated --
Code:
select ID
, ResourceTypeID as maxResourceTypeID
, Name
from yourtable as X
where ResourceTypeID
= ( select max(ResourceTypeID)
from yourtable
where Name = X.Name )
Bookmarks