Re: Multiple SELECT statements Using One WITH statement

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Re: Multiple SELECT statements Using One WITH statement
Дата
Msg-id CAD3a31X8WPvxiigFObf46Eui4aGF_c6HBmNTQpqN7zi5Hhqpgg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Multiple SELECT statements Using One WITH statement  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Multiple SELECT statements Using One WITH statement
Список pgsql-general


On Thu, Jan 20, 2022 at 8:46 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
You can always write:

CREATE VIEW cte_view AS
WITH cte AS (...)
SELECT * FROM cte;

And then incorporate that into any queries that require the results of said CTE.


Is there any advantage to still using a CTE inside the view definition, and then selecting it?  Instead of just

CREATE VIEW cte_view AS
(...);

Just curious, in case I'm missing something!

Cheers,
Ken


--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

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