subquery_aggregation.sql 250 B

1234567891011121314
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. USE plato;
  4. $total_count = (SELECT Count(*) from Input);
  5. SELECT
  6. common,
  7. count(*) as rec_count,
  8. 100. * count(*) / $total_count as part_percent
  9. FROM Input
  10. GROUP BY subkey as common
  11. ORDER BY common
  12. ;