On Fri, Dec 07, 2007 at 01:18:13PM +0800, Ow Mun Heng wrote:
> select i.i as vdt,dcm_evaluation_code as c_id
> , case when count(vdt_format) = 0 then NULL else count(vdt_format) end
> as count
> from generate_series(1,7) i
> left join footable f
> on i.i = f.vdt_format
> and c_id in ('71','48')
> g
On Thu, 2007-12-06 at 23:06 -0500, Rodrigo De León wrote:
> On Dec 6, 2007 10:44 PM, Ow Mun Heng <[EMAIL PROTECTED]> wrote:
> > I've got a desired output which looks something like this..
> >
> > vdt| count
> > +---
> > 1 | 514
> > 2 |27
> >
On Dec 6, 2007 10:44 PM, Ow Mun Heng <[EMAIL PROTECTED]> wrote:
> I've got a desired output which looks something like this..
>
> vdt| count
> +---
> 1 | 514
> 2 |27
> 3 |15
> 4 |
> 5 |12
> 6 |1
I've got a desired output which looks something like this..
vdt| count
+---
1 | 514
2 |27
3 |15
4 |
5 |12
6 |15
the query in psql is something like this..
select vdt, count(*) from footable