title: Sqlite: How to get the percentage of a total as a column
body: <p>I have a table with sequences and their total occurrence and I'd like to create a column which shows the percentage of the total of all sequences.</p>
  
  <p>This is the basic table:</p>
  
  <p>sequence</p>
  
  <p>e3a0b000<br/>
  e92d4030<br/>
  e59f3038<br/>
  e1a0c00d<br/>
  e1a0c00d<br/>
  e1a0c00d<br/>
  e1a0c00d<br/>
  ...</p>
  
  <pre><code>SELECT sequence, Count(*) AS total
  FROM seq_one
  GROUP BY sequence
  ORDER BY total DESC
  </code></pre>
  
  <p>Which then gives me this:</p>
  
  <p>sequence | total</p>
  
  <p>e1a0c00d | 155<br/>
  e3510000 | 2<br/>
  e2512001 | 1<br/>
  e3a0b000 | 1<br/>
  e59f3038 | 1<br/>
  e92d4010 | 1<br/>
  e92d4030 | 1</p>
  
  <p>Then applying this to the temporary table:</p>
  
  <pre><code>SELECT sequence, total, total*1.0/SUM(total) as relative
  FROM (SELECT sequence, Count(*) AS total
        FROM seq_one
        GROUP BY sequence
        ORDER BY total DESC)
  </code></pre>
  
  <p>Gives me this:</p>
  
  <p>sequence | total | relative<br/>
  e1a0c00d | 155   | 0.95679012345679</p>
  
  <p>I would like to get the whole column instead of only the first row.</p>