怎么从一张表中剔除数据

问题遇到的现象和发生背景

比如想从A表中剔除B表里某字段为1的数据

问题相关代码,请勿粘贴截图
create table if not exists testA(
user_id string,
user_name,
level string
);

create table if not exists testB(
user_id string,
tag int
);
--testA和testB两张表可以通过user_id相关联,现在希望两表关联,testB中tag字段为1的,从testA表里剔除出去
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

testA和testB两张表可以通过user_id相关联,现在希望两表关联,testB中tag字段为1的,从testA表里剔除出去

DELETE FROM testa WHERE user_id IN (SELECT user_id FROM testb WHERE tag=1);

如果只是查询,not in 或not exists 都行

select * from testA as  a where not exists (select 1 from testB as  b where a.user_id=b.user_id and b.tag=1);

如果是要删除A表中的数据,用in 或者exists 都行

delete  testA as  a where exists (select 1 from testB as  b where a.user_id=b.user_id and b.tag=1);

借用楼上的sql语句试试看这个
INSERT OVERWRITE TABLE testA select * from testA as a where not exists (select 1 from testB as b where a.user_id=b.user_id and b.tag=1);