Hi this query i am trying to run in MySQL to get well distribution over my ID but looks like some issue in syntax .
select min(ID), max(ID),count(*), nt from ( select ID, ntile(16) over (order by ID) nt from table) group by nt order by nt;
This is working in Oracle but not MySQL may be looks like its not available in MySQL 5.7 . How else can we get this data ?
Basically i have UUID application generated which can be ordered and in need to organize and group and then divide in 16 segment .
Expected output
MIN(ID)                                 MAX(ID)                       COUNT(*)               NT                                                           
                                                         
00000000-ebc5-4d19-9d7b                 0a360b83-6d9a-17d7-9b67            36282227          1                   
0a360b83-6d9a-17d7-9b67                 0a360b85-6ebb-1bbc-9bbb            36282227          2
 
    