pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jakub Ouhrabka <jouh8664@ss1000.ms.mff.cuni.cz>
To: Ian Barwick <barwick@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: difficult query (fwd)
Date: Sat, 4 May 2002 21:21:34 +0200 (CEST)
Message-ID: <Pine.LNX.4.33.0205042104480.19063-100000@u-pl2> (raw)
In-Reply-To: <Pine.LNX.4.44.0205042102370.21992-100000@server>

> well, you could do it like this I suppose:
>
> SELECT 1 AS day, COUNT(data) FROM table1 WHERE day=1
>  UNION
> SELECT 2, COUNT(data) FROM table1 WHERE day=2
>  UNION
> SELECT 3, COUNT(data) FROM table1 WHERE day=3
>  UNION
> SELECT 4, COUNT(data) FROM table1 WHERE day=4
>
> (and so on ad infinitum)

yeah, i was thinking about something like this and thought it can't be
correct because it would be infinite. but now i realized that it isn't
really infinite, it's just maxint unions, perfectly finite :) maybe it's
this what was mention as a curiosity on that sql course... very ugly ;)
and it would be even uglier when you use it as a from clause for
select limiting the result to be in min(day)..max(day) range... really
funny...

thanks,           kuba




Message-ID: <Pine.LNX.4.33.0205042104480.19063-100000@u-pl2>
Permalink:  ../Pine.LNX.4.33.0205042104480.19063-100000@u-pl2/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0205042104480.19063-100000@u-pl2

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: jouh8664@ss1000.ms.mff.cuni.cz, barwick@gmx.net
  Subject: Re: difficult query (fwd)
  In-Reply-To: <Pine.LNX.4.33.0205042104480.19063-100000@u-pl2>
  References: <Pine.LNX.4.44.0205042102370.21992-100000@server> <Pine.LNX.4.33.0205042104480.19063-100000@u-pl2>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox