In SQL Cookbook and example is given of wrapping query as inline view. Tried in pgadmin but got error. Simplified but still got error. Syntax error at or near SELECT.
SELECT * FROM (SELECT prod_id, prod_price FROM Products)
(SELECT prod_id, prod_price FROM Products of course works)
Any help appreciated!
CodePudding user response:
The derived subquery requires an alias:
SELECT * FROM (SELECT prod_id, prod_price FROM Products) t;
-- ^^ change is here