Counts and percentages and such

From: jackassplus <jackassplus(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Counts and percentages and such
Date: 2009-12-08 18:50:54
Message-ID: ba347e2e-cc86-415f-9d1c-d72cc50ea284@z10g2000prh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm new to both pgsql and SQL in general pas really simple stuff, so
i would like to know how to;

Given a table with a column that can have one of NULL, (char) N,
(char) A, and (char) L. Is there a way to in a single query, ge the
percentage of the whole rowset that each of those represents?

like :

75% Null
15% A
5% N
5% L

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Allan Kamau 2009-12-08 19:12:26 Re: Implementing next 30 (or so) rows "sliding window"
Previous Message Allan Kamau 2009-12-08 18:49:13 Implementing next 30 (or so) rows "sliding window"