Question

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!

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top