title: NRQL percentage of one subset over another
body: <p>I have a great big eventing table with lots of different types of events, and I'm working on a New Relic graph to show the percentage of one kind of event to another kind of event. (NOT percentage over the total row count in the table).</p>
  <p>So in this example Segment table:</p>
  <pre><code>id  name
  1   foo      
  2   bar
  3   baz
  4   bar
  </code></pre>
  <p>I'd get the foo events with a query like this:</p>
  <pre><code>select count(*) from Segment where name='foo'
  </code></pre>
  <p>My question: how would I get the percentage of foo events to bar events? I've poked around trying to join two queries that save each &quot;as&quot; a particular name, but no luck yet. Does anyone know if/how we can make Common Table Expressions for use in a query/graph?</p>