title: How do I count the number of users with a higher score than [userID]?
body: <p>I have the following SQL code that returns the number of entries that have a higher score than a specific entry.</p>
  
  <pre><code>select (select count(*)
      from entries e2
      where e1.score &lt; e2.score) + 1 as pos
  from entries e1
  where e1.ID = 36;
  </code></pre>
  
  <p>I am having a lot of trouble translating this into Sequelize.js. I have a solution that achieves this in 2 queries, but I'd like to do it in a single query.</p>
  
  <pre><code>this.dal.Entries.getPositionInList = (ID: number) =&gt; {
    return this.db.Entries.findOne({
      where: {
        ID: ID
      }
    }).then((entry: any) =&gt; {
      return this.db.Entries.findAndCountAll({
        where: {
          score: {
            $gt: entry.score
          }
        }
      });
    });
  };
  </code></pre>