문제

I am trying to using the NTILE function to create deciles in a dataset using Navicat for MySQL. My query is:

select NTILE(10) over (order by 'amount') decile, *
from dataframe d
order by 'amount';

I get the error

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(order by.....

Can anyone help figure out what is wrong with my query?

Thanks in advance!

도움이 되었습니까?

해결책

NTILE is what is called a window function (MS SQL Info).

MySQL does not have window functions: https://dba.stackexchange.com/questions/40130/mysql-and-window-functions

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top