想删除数据库表cbf_jtcy中cyzjhm字段重复且yhzgx字段值不等于02的那行记录,
写了以下语句
delete from cbf_jtcy
where cyzjhm in (select cyzjhm from cbf_jtcy group by cyzjhm having count(cyzjhm)>1)
and where yhzgx <>02
表名改成[cbf_jtcy] ,yhzgx字段不知道是文本还是数值?是文本就加引号delete from [cbf_jtcy] where cyzjhm in
(select cyzjhm from [cbf_jtcy] where yhzgx <>‘02' group by cyzjhm having count(cyzjhm)>1)