Multiple SRF right after SELECT

Поиск
Список
Период
Сортировка
От Nikolay Samokhvalov
Тема Multiple SRF right after SELECT
Дата
Msg-id e431ff4c0803190503m49eeef76pb91a692009a30331@mail.gmail.com
обсуждение исходный текст
Ответы Re: Multiple SRF right after SELECT  (Albert Cervera i Areny <albert@nan-tic.com>)
Re: Multiple SRF right after SELECT  (Volkan YAZICI <yazicivo@ttmail.com>)
Re: Multiple SRF right after SELECT  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

I wonder, if the following is correct and provides expected result:

test=# select generate_series(1, 2), generate_series(1, 4);generate_series | generate_series
-----------------+-----------------              1 |               1              2 |               2              1 |
            3              2 |               4
 
(4 rows)


Actually I have two questions on this:1. Is it correct at all to use SRF in select list, w/o explicit FROM?
Why then we do not allow using subselects that return multiple rows?
I'd rather expect that these two things work in similar manner.2. Why the query above provides 4 rows, not 2*4=8?
Actually,that's
 
interesting -- I can use this query to find l.c.m. But it's defenetely
not that I'd expect before my try...
-- 
Best regards,
Nikolay


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: fast count(*) through statistics collector
Следующее
От: Kenneth Marshall
Дата:
Сообщение: Re: [PATCHES] Fix for large file support (nonsegment mode support)