Reputation:
(Using postgresql 9.1)
I have a view and I'm trying to remove the row corresponding to the maximum values to find the second highest value. I want to store this new relation in another view.
CREATE VIEW SomeView AS
SomeOtherView
EXCEPT
(SELECT *
FROM SomeOtherView
WHERE attribute = (SELECT max(attribute) FROM SomeOtherView));
It keeps telling me there's a syntax error around the first "SomeOtherView" but I can't seem to fix it.
Upvotes: 0
Views: 55