Re: difficult query

From: Ian Barwick <barwick(at)gmx(dot)net>
To: Jakub Ouhrabka <jouh8664(at)ss1000(dot)ms(dot)mff(dot)cuni(dot)cz>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: difficult query
Date: 2002-05-04 15:44:48
Message-ID: 200205041744.48054.barwick@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Saturday 04 May 2002 16:00, Jakub Ouhrabka wrote:
> Hi,
>
> I'd like to ask how to write sql query returning following results without
> using any other table than table1 (e.g. without outer join with table
> containing all possible day numbers...)
(...)
> I'd like to write query returning this:
>
> query results:
> day | number of records for a day
> ----------------------
> 1 | 2
> 2 | 1
> 3 | 0 <--- !!!
> 4 | 2
>
> Is it possible to do this in sql?

Basically, no. (You might be able to do it with the help
of a user-defined function though).

Why do you want to do this?

Ian Barwick

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jakub Ouhrabka 2002-05-04 17:34:03 Re: difficult query
Previous Message Jakub Ouhrabka 2002-05-04 14:00:11 difficult query