mysql delete 只能删除一条记录
我在mysql中使用一组筛选条件来query可以得到多条记录但是将query改成delete以后,用同样的,一幕一样的筛选条件,却只能删除一条记录。每次我重跑该delet...
我在mysql中使用一组筛选条件来query
可以得到多条记录
但是将query改成delete以后,用同样的,一幕一样的筛选条件,却只能删除一条记录。每次我重跑该delete语句的时候,都可以删除一条记录,但是也只能删除一条记录。
请问这是什么原因?
where语句比较复杂。里面总共有11句“and(字段名='' or 字段名 is null”
还有三句 “id not in (子查询)”
是因为条件太多了么?
请教高人
我的语句就是在数据库客户端跑的。
语句是
select * from customer_abc._t_member where given_name = 'à?aà??à?2à??à?′à??à1?à??à??à1?' and (mbl_nbr='' or mbl_nbr is null) and (email=''or email is null) and (home_addr_city = ''or home_addr_city is null ) and (home_addr_strt = ''or home_addr_strt is null ) and (home_tel_nbr = '' or home_tel_nbr is null) and (work_addr_strt is null or work_addr_strt = '') and (other_tel_nbr = '' or other_tel_nbr is null) and (home_addr_pcode='' or home_addr_pcode is null) and (birth_date='' or birth_date is null or birth_date = '0000-00-00') and (nric='' or nric is null) and (family_name = ''or family_name is null) and member_id not in ( select distinct member_id from customer_abc._t_sales_detail) and member_id not in ( select distinct memberId from customer_abc.event_2009_target) and member_id not in ( select distinct memberId from customer_abc.event_2008_target) and member_id not in ( select distinct memberId from customer_abc.event_2007_targe 展开
可以得到多条记录
但是将query改成delete以后,用同样的,一幕一样的筛选条件,却只能删除一条记录。每次我重跑该delete语句的时候,都可以删除一条记录,但是也只能删除一条记录。
请问这是什么原因?
where语句比较复杂。里面总共有11句“and(字段名='' or 字段名 is null”
还有三句 “id not in (子查询)”
是因为条件太多了么?
请教高人
我的语句就是在数据库客户端跑的。
语句是
select * from customer_abc._t_member where given_name = 'à?aà??à?2à??à?′à??à1?à??à??à1?' and (mbl_nbr='' or mbl_nbr is null) and (email=''or email is null) and (home_addr_city = ''or home_addr_city is null ) and (home_addr_strt = ''or home_addr_strt is null ) and (home_tel_nbr = '' or home_tel_nbr is null) and (work_addr_strt is null or work_addr_strt = '') and (other_tel_nbr = '' or other_tel_nbr is null) and (home_addr_pcode='' or home_addr_pcode is null) and (birth_date='' or birth_date is null or birth_date = '0000-00-00') and (nric='' or nric is null) and (family_name = ''or family_name is null) and member_id not in ( select distinct member_id from customer_abc._t_sales_detail) and member_id not in ( select distinct memberId from customer_abc.event_2009_target) and member_id not in ( select distinct memberId from customer_abc.event_2008_target) and member_id not in ( select distinct memberId from customer_abc.event_2007_targe 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |