B
B
Black back2019-11-25 13:36:04
PostgreSQL
Black back, 2019-11-25 13:36:04

Why doesn't creating a temporary table with WITH in Psql work?

let's say I created a person table for example
create table person(
id serial not null,
fname varchar(30),
lname varchar(39)
)
insert into person values
​​(1,'beks', 'akyl'),
(2,'bek' , 'aky'),
(3,'aky', 'baz');
with cte_person as (
select fname,lname from person )
want to display data from temporary table but missing :
SELECT * FROM cte_person;
What is the problem ((((((((??? Teach me how to create a temporary table

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2019-11-25
@bekss

cte is an integral part of the request and does not live on its own!
with cte_qqqq(...) as (
...
)
select ...
join cte_qqqq
...
and temporary tables...
https://postgrespro.ru/docs/postgrespro/9.5/sql-cr...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question