-2
Create Temporary Table Temp3 ( 
user_id int not null,
) AS query(
select id 
from users
)

I use the above code in postgresql but it says:

ERROR: syntax error at or near ")" LINE 3: ) AS ( ^

****** Error ******

ERROR: syntax error at or near ")" SQL state: 42601 Character: 55

How can I fix it to do the same job? Thx ahead!

user3315620
  • 199
  • 2
  • 3
  • 12

1 Answers1

0

It is much simpler than your try:

create temporary table Temp3 as
    select id as user_id
    from users;

SeeCREATE TABLE AS

klin
  • 99,138
  • 12
  • 177
  • 203