On Tuesday, 3 December, 2019 05:39, gideo...@lutzvillevineyards.com wrote:

>My query is :

>UPDATE wbridge_history
>SET yearclass =
>(
>SELECT D.wynklas
>FROM
>(
>SELECT LidNo, PlaasNo, BlokNo, oesjaar, wynklas,
>ROW_NUMBER() OVER (PARTITION BY LidNo, PlaasNo, BlokNo, oesjaar ORDER BY
>COUNT(*) DESC, SUM(ton) DESC) AS row_num FROM wbridge_history GROUP BY
>LidNo, Plaasno, BlokNo, oesjaar, wynklas
>) D
>WHERE D.LidNo = wbridge_history.LidNo
>AND D.PlaasNo = wbridge_history.PlaasNo
>AND D.BlokNo = wbridge_history.BlokNo
>AND D.oesjaar = wbridge_history.oesjaar
>AND D.row_num = 1
>);

This prepares without error on version 3.31.0 so, as Simon says, you probably 
just have a version of SQLite3 that does not do window functions (ie, prior to 
3.25.0) in which ROW_NUMBER() would have been parsed as a function call, OVER 
as a column alias name, and the "(" as a syntax error (only a "," the keyword 
"FROM", or the end of statement ";" could validly appear after an expression in 
the select list).

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to