title: How to use SELECT DISTINCT and SELECT TOP n in T-SQL
body: <p>I have this query:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[MySP]
      @Q Nvarchar(512)
  AS BEGIN
  
  SET @Q = REPLACE(@Q, N'%', N'');
  SET @Q = N'"' + @Q + N'*' + N'"';
  
  SELECT TOP 8 
         [KeywordId] as ID,
         [Keyword] as lable,
         [Keyword] as value
    FROM [dbo].[News_Keywords]
    WHERE CONTAINS ([Keyword], @Q)
    ORDER BY SortOrder, len([Keyword])
  
  END
  </code></pre>
  
  <p>What I'm asking for, is how can I apply <code>DISTINCT</code> functionality (on column <code>[Keyword]</code>) to this statement? It's completely confusing me! Thanks in advance.</p>