select * from code1 c where not exists(select 1 from area a where a.codeid=c.code);你试试这个,子查询里不需要写外表的别名
exist用法写错了。select * from code1 c where not exists(select code from area a where a.codeid=c.code);这样写