I'm new to postgresql. Can anyone suggest the reason and solution to this error? However it works if I select an extra sum(s.length) but i don't won't this in my results.
code:
create or replace view q1("group",album,year)
as
select g.name, a.title, a.year
from Groups g, Albums a, Songs s
where a.made_by = g.id and s.on_album = a.id
group by a.title, g.name, a.year
order by sum(s.length) desc
limit 1
;
Error message:
ERROR: cannot drop columns from view