首页 > 解决方案 > mysql -- ERROR 1064 (42000): .... near '(PARTITION BY t1.DIGEST)

问题描述

我试图在 ubuntu/mysql 中执行这个查询:

SELECT t1.SCHEMA_NAME, CONCAT(ROUND(BUCKET_QUANTILE*100,2),"% under ",
               BUCKET_TIMER_HIGH/1000000000," milliseconds") fact, 
               LEFT(QUERY_SAMPLE_TEXT,64) as QUERY_SAMPLE, t1.DIGEST, 
               COUNT(t1.DIGEST) 
               OVER(PARTITION BY t1.DIGEST) as TOT 
              FROM events_statements_histogram_by_digest t1 
              JOIN events_statements_summary_by_digest t2 
                ON t2.DIGEST = t1.DIGEST 
             WHERE COUNT_BUCKET >1 
             ORDER BY t1.DIGEST, BUCKET_TIMER_HIGH DESC 
             LIMIT 10\G

结果:

ERROR 1064 (42000): 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 
'(PARTITION BY t1.DIGEST) as TOT FROM events_statements_histogram_by_digest t1 JO' 
at line 1

我还没有找到纠正该查询的方法。请帮忙。谢谢。

标签: mysqlubuntu

解决方案


推荐阅读