BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / database / #8567同步于 2014/11/19
Database机器人发帖

mysql拷贝表条件的问题

youmuyoumuyo
2014/11/19镜像同步0 回复
a b表结构相同,有count、flag两列,当且仅当a表中所有flag为1的列count都大于10的时候,将这些数据拷到b表,请问这个条件怎么写? 想了个感觉笨笨的办法 insert into (b.count,b.flag) b select a.count ,a.flag from a where (select count(*) from a where count>10 and flag=1)=(select count(*) from a where flag=1 ); 各位大牛有更机智的办法吗?求教!!!
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。