【发布时间】:2020-07-27 01:13:06
【问题描述】:
为什么会出现这个错误?
"代码: 43, e.displayText() = DB::Exception: 非法类型 (Enum8('' = 0, 'Manhattan' = 1, 'Bronx' = 2, 'Brooklyn' = 3, 'Queens' = 4, 'Staten Island' = 5)) 的 2 个函数参数和 (version 20.3.4.10 (official build))"
select pickup_boroname as region, toHour(pickup_datetime) as time_, count(payment_type_) as pay_count
from datasets.trips_mergetree
where pickup_date between '2011-01-01' and '2011-12-31' and
pickup_boroname != 0
group by time_ and region
order by pay_count desc;
【问题讨论】:
-
表中有出租车数据:pickup_boroname - 城市区域(enum8) Pickup_date - 行程数据;pickup_datetime - 行程数据和时间;我无法按时间和地区计算付款:
-
表格有列,而不是字段。
-
如果你在 where 子句中写:pickup_boroname != '' 而不是picking_boroname != 0 是否有效?还有这些列的列类型是什么?
-
@Sourcery,它是 enum8 : "" - 0(空字符串),'Manhattan' - 1 等等
-
如果有人有同样的问题,错误是因为
group by time_ and region,我必须写group by time_ , region
标签: mysql sql database clickhouse