title: Incorrect syntax near 'LIMIT' using mssql
body: <p>I'm trying to retrieve some data from the database, which need to be the top 10 of the agents with the highest score.</p>
  
  <p>My Query: </p>
  
  <pre><code>SELECT AgentScores.agentID, 
         AgentScores.totalScore, 
         Agents.firstname, 
         Agents.lastname 
  FROM AgentScores 
  INNER JOIN Agents ON AgentScores.AgentId=Agents.Agent_id 
  ORDER BY AgentScores.totalScore DESC 
  LIMIT 10
  </code></pre>
  
  <p>The inner joins are working. I've found the <code>SELECT TOP 10</code> sql statement but.. I want the 10 agents with the highest score and not the first 10 id's. As you can see I'm ordering on the totalscore.</p>
  
  <p>Anyone has a clue how to fix this?</p>
  
  <p>Error: <code>Array ( [0] =&gt; Array ( [0] =&gt; 42000 [SQLSTATE] =&gt; 42000 [1] =&gt; 102 [code] =&gt; 102 [2] =&gt; [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near 'LIMIT'. [message] =&gt; [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near 'LIMIT'. ) )</code> </p>
  
  <p>Thank you!</p>