I understand the distinct/group by function - SQL Server 2008 : Here is an short example what I have in my BDD :

    Ref   | NameContact | CODE
    SF005 | Toto        | SF
    SF006 | Titi        | BC
    SF005 | Toto        | SF
    SF007 | Foo         | FB
    SF006 | Bar         | BC
    SF005 | Tata        | SF
    SF005 | Tata        | SF

I like to get this : 

    Ref   | NameContact |CODE
    SF005 | Toto        | SF
    SF005 | Tata        | SF

I've tried to use Distinct but it doesn't work correctly but it'work when i use Group By with all named column with MAX() but i've many columns and the query is very big. There is a better solution ? 

    SELECT MAX(Ref),NameContact,Code FROM MyTable WHERE CODE = 'SF' GROUP BY NameContact,Code