RETURNING parameter in SELECT (postgres)

163 Views Asked by At
SELECT * FROM users WHERE user_id = '423423432r32' RETURNING name

Does the RETURNING clause exist in SELECT, and if it doesn't, what can I use instead of to get the same result?

1

There are 1 best solutions below

0
On BEST ANSWER

From your comments and from what I can understand from your question what you want is just the result of the query

SELECT name FROM users WHERE user_id = '423423432r32'

the return statement is more used for things like

insert into table1 (foo, bar, baz) values (X, Y, Z) returning *

so that you can see the updated or inserted rows,

more info here