SQL 错误 [47]: ClickHouse exception, code: 47, host: 192.168.2.101, port: 8123; Code: 47, e.displayText() = DB::Exception: Missing columns: 'DISTINCT' while processing query: 'SELECT DAY, AREA_TYPE, AREA_ID, DISTINCT AS MSISDN, AGE FROM TV_D_AREA_VISITOR_IMSI_ALL', required columns: 'DAY' 'AREA_TYPE' 'AGE' 'AREA_ID' 'DISTINCT', source columns: 'PHONE_BILL' 'AGE' 'OWNER_CITY' 'OWNER_PROV' 'RESID_DURA' 'NATIONALITY' 'MSISDN' 'IS_OVERNIGHT' 'DAY' 'SEX' 'AREA_CITY' 'AREA_PROV' 'AREA_ID' 'SOURCE_COUNTRY' 'MOBILE_DATA' 'APP' 'AREA_TYPE' (version 20.8.3.18)
时间: 2023-09-19 08:12:06 浏览: 516
java.sql.SQLException: null, message from server: “Host ‘%’ is not allowed to connect to
这个错误提示是因为在你的 SQL 查询语句中,使用了关键字 DISTINCT 作为一个列名,而 DISTINCT 是 SQL 中的关键字,用于去重。因此,你需要修改查询语句,将 DISTINCT 作为列名改为其他合法的列名。比如,将查询语句改为:
SELECT DAY, AREA_TYPE, AREA_ID, MSISDN AS DISTINCT_MSISDN, AGE FROM TV_D_AREA_VISITOR_IMSI_ALL
这样就可以避免关键字冲突导致的错误。
阅读全文