这是我的查询,如果我运行错误是:查询错误:ORA-00907:缺少右括号,任何人都可以解决我的问题?
Create table r_tcash_loci_act_tmp AS (
SELECT DISTINCT
R_TCASH_LOCI_ACT.MSISDN AS MSISDN_LOCI,
R_TCASH_ACT_MSISDN.MSISDN AS MSISDN_ACT,
R_TCASH_LOCI_ACT.AREA,
R_TCASH_LOCI_ACT.REGIONAL,
R_TCASH_LOCI_ACT.BRANCH,
R_TCASH_LOCI_ACT.SUB_BRANCH,
R_TCASH_LOCI_ACT.CLUSTERX,
R_TCASH_LOCI_ACT.UPDATED,
R_TCASH_ACT_MSISDN.DAILY,
R_TCASH_ACT_MSISDN.TOTAL_TRX,
R_TCASH_ACT_MSISDN.TOTAL_VOL
FROM R_TCASH_ACT_MSISDN
INNER JOIN R_TCASH_LOCI_ACT
ON R_TCASH_LOCI_ACT.MSISDN = R_TCASH_ACT_MSISDN.MSISDN
GROUP BY R_TCASH_LOCI_ACT.MSISDN AS MSISDN_LOCI
HAVING COUNT(R_TCASH_LOCI_ACT.MSISDN ) > 10);
我坚持这一点,谢谢先进的
答案 0 :(得分:1)
这是一个简单的语法错误。您在GROUP BY
子句中包含了列别名(可能是剪切' n'粘贴错误)。
GROUP BY R_TCASH_LOCI_ACT.MSISDN AS MSISDN_LOCI
所以只需删除AS MSISDN_LOCI
。
虽然假设您有一个DISTINCT
子句而且没有汇总列,但您完全拥有GROUP BY
的原因却是个谜。你应该删除整行。