title: QUANTILE FUNCTION IN TERADATA
body: <p>I wanna get somes categories with quantile function, but i am getting the min and max of quantile.
  Example</p>
  <pre><code>SELECT * 
  FROM
   ( SELECT ID, SALES, QUANTILE(5, SALES) AS QUINTIL 
     FROM 
      ( SELECT ID, SUM(SALES)  AS SALES
        fROM TABL1
        WHERE  TIME_PER = 202004
        GROUP BY 1
      ) AS TABL
   ) AS TABL
  </code></pre>
  <p>RESULT</p>
  <p><a href="https://i.stack.imgur.com/zNNt0.png" rel="nofollow noreferrer">enter image description here</a></p>