title: SQLite equivalent of Over (Partition)
body: <p>I have the following query in SQL server. The database is now being utilized on a mobile device using SQLite. Can someone help with an equivalent that will work in SQLite?</p>
  
  <pre><code>Select DISTINCT TblSites.Customer, TblSites.Digit, Count(TblContractTasks.TaskNumber) OVER (PARTITION BY TblSites.Digit)  As TaskCount 
  FROM TblContractTasks INNER Join (TblSites INNER Join TblContractDetails On TblSites.Digit = TblContractDetails.SiteDigit) On TblContractTasks.ContractNumber = TblContractDetails.ContractNumber 
  WHERE TblSites.Consultant='xx'  
  ORDER BY TblSites.Digit
  </code></pre>
  
  <p>Table:</p>
  
  <pre><code>Customer   Site   TaskNumber
  ------------------------
  Ca          Sa      100
  Ca          Sa      101
  Cb          Sb      88
  Ca          Sa      103
  </code></pre>
  
  <p>Results of query:</p>
  
  <pre><code>Customer    Site   TaskCount
  -----------------------
  Ca           Sa      3
  Cb           Sb      1
  </code></pre>