title: BigQuery: Standard SQL and the PERCENTILE_CONT() function
body: <p>I am trying to write a query using BigQuery Standard SQL (as there are some features we want to take advantage of).  </p>
  
  <p>Is there an equivalent function in Standard SQL for PERCENTILE_CONT() as it only seems to be supported when using the Legacy SQL option?</p>
  
  <pre class="lang-sql prettyprint-override"><code>WITH  
    CTE_EmployeeData AS (  
    SELECT  
      E.JobID,  
      E.FB1  
    FROM  
      ZA_Month_End_190.Employee_Primary_Data E  
    WHERE  
      JobID IN UNNEST([111,1414]) /* For these specidifc jobs */  
      ),  
    CTE_Stats AS (  
    SELECT   
      JobID,          
      COUNT(*) SampleSize,        
      SUM(CASE WHEN FB1 &gt; 0 THEN 1 ELSE 0 END) WtdSampleSize_FB1,  
      CAST(SUM(FB1) AS INT64) WtdSum_FB1  
    FROM  
      CTE_EmployeeData  
    GROUP BY   
      JobID  
    ),  
    CTE_Percentiles AS (  
      SELECT  
        ED.JobID,        
        CASE 
          WHEN S.SampleSize &gt; 10 
          THEN PERCENTILE_CONT(0.25) OVER (PARTITION BY ED.JobID ORDER BY ED.FB1 DESC) [Percentile1] 
          ELSE 0 
        END [FB1_Percentile1]        
      FROM         
        CTE_Stats S  
      INNER JOIN CTE_EmployeeData ED ON S.JobID = ED.JobID  
    )  
  SELECT
    *
  FROM
    CTE_Percentiles
  </code></pre>