Re: losing my mind about sytnax error in window clause
| От | Rob Sargent |
|---|---|
| Тема | Re: losing my mind about sytnax error in window clause |
| Дата | |
| Msg-id | 884E562F-4402-44B6-90C5-F50EEFA99320@gmail.com обсуждение исходный текст |
| Ответ на | losing my mind about sytnax error in window clause (Rein Petersen <email@reinpetersen.com>) |
| Список | pgsql-sql |
Why doesn’t your colorizer pick up ‘window’? Perhaps it doesn’t pickup ‘partition' either (when properly spelled)?On Jun 7, 2022, at 7:03 PM, Rein Petersen <email@reinpetersen.com> wrote:Hi Folks,I've been reading the docs over and again, searching exhaustively for examples on the internet to help me here and I'm ready to give up.I have a query using windows function:SELECTlast_value ( typechange ) OVER w,pindex,lid,last_value ( modified ) OVER w,last_value ( created ) OVER w,last_value ( modifiedby ) OVER w,last_value ( createby ) OVER w,last_value ( cost ) FILTER ( WHERE cost IS NOT NULL ) OVER w,last_value ( sell ) FILTER ( WHERE sell IS NOT NULL ) OVER wFROM ps._delta_extWHERE pindex = Ppindex AND( Plid IS NULL OR lid = Plid ) AND( Ptimestamp IS NULL OR modified <= Ptimestamp )GROUP BY lid, pindexWINDOW w AS ( PARITION BY lid, pindex ORDER BY created );Complains about syntax error in the WINDOW cause (last line) on [PARTITION] BY:/* messagesERROR: syntax error at or near "BY"LINE 16: WINDOW w AS ( PARITION BY locationid, partindex ORDER BY cr...^SQL state: 42601Character: 2724*/Maybe my error is clear to someone else, could really use helping hand, thanks.Rein
В списке pgsql-sql по дате отправления: