客户需要我们提供一个更新表内数据项的接口,系统是古老版的StarRcoks(客户的服务器我们进不去无法确定版本号,但是update代码功能不支持)
作为替代只能先delete再insert了
然后我尝试批量delete,发现也不行,具体情况如下
delete from dws_mediation.dws_event_case_info where event_source_pk in (select event_source_pk from dws_mediation.dws_event_source_pk)
报错
1064--Child of in prdeicate should be value
发现不行之后,尝试其他方式
DELETE FROM dws_mediation.dws_event_case_info USING dws_event_source_pk
WHERE event_source_pk = event_source_pk;
报错
1064 - Syntax error in line 1:
...ation.dws_event_case_info `USING` dws_event_source_pk
^
Encountered: IDENTIFIER
Expected
嗯,还是不行,再换
delete from dws_mediation.dws_event_case_info where exists (select event_source_pk from dws_mediation.dws_event_source_pk as a);
还是报错
1064 - Where clause only supports compound predicate, binary predicate, is_null predicate and in predicate
好嘛,StarRocks版本实在太低,都不支持。想问问又没有码友能给出方法,替换update或者替换delete where in的都可以。