SELECT codart,quantite,datfac
,count(quantite) over (partition by codart order by codart ) as qte
FROM MOUVEMENT where codart is not null
42 ?
,count(quantite) over (partition by codart) as qte
What is the ultimate question?
You can't use ORDER BY with a COUNT or SUM function, because it doesn't make sense there. Also, my guess is you want SUM() rather than COUNT() of quantite, although technically you could just want the COUNT; if so, naturally just change the SUM back to COUNT:
SELECT codart,quantite,datfac
,SUM(quantite) over (partition by codart /* remove the ORDER BY! */) as qte
FROM MOUVEMENT
WHERE codart IS NOT NULL
I presume its as per the Subject, which I assume translates to the English error message "Incorrect syntax near keyword 'ORDER'"
