以下 SELECT 查询工作正常:
select
StringField_1
, StringField_2
, StringField_3
, COUNT(*)
from my.table
where StringField_1 in (
select StringField_1
from my.table
)
group by
StringField_1
, StringField_2
, StringField_3
having
COUNT(*) > 10
and StringField_3 like '.*some_string_here.*'
;
结果:
|StringField_1 | StringField_2 | StringField_3 |
|-------------- | ------------- | ------------- |
(0 行受影响)
但是具有上述输出的 UPDATE 失败:
update my.table
set
StringField_1 = 'CLEAR'
, numField_1 = 0
where StringField_1 in (
select
StringField_1
, StringField_2
, StringField_3
, COUNT(*)
from my.table
where StringField_1 in (
select StringField_1
from my.table
)
group by
StringField_1
, StringField_2
, StringField_3
having COUNT(*) > 10 and StringField_3 like '.*some_string_here.*'
);
出现以下错误:
ERROR=非法选择列表不能同时包含语句'update my.table set StringField_1 = 'CLEAR', numField= 0 where StringField_1 in (select StringField_1, StringField_12, StringField_13, COUNT(*) from my.table where StringField_1 in (select StringField_1 from my.table) group b...', at or near 'group'
有什么线索吗?