Re: difficult query (fwd)

Поиск
Список
Период
Сортировка
От Jakub Ouhrabka
Тема Re: difficult query (fwd)
Дата
Msg-id Pine.LNX.4.33.0205042104480.19063-100000@u-pl2
обсуждение исходный текст
Список pgsql-sql
> 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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Joseph Barillari
Дата:
Сообщение: Re: Syntax error in plpgsql crashes backend
Следующее
От: Joseph Barillari
Дата:
Сообщение: More long-string woes