1、修改语句
update `my_part` set partner_id = (select id from my_part where my_part.name=my_bank.name limit 1)
update my_product set PV= CEILING(RAND()*9000+1000) ;
update my_product set BV= CEILING(RAND()*300+100) ;
2、统计语句,关键词:HAVING
SELECT `no`, count(1) AS `selectCount` FROM `by_user` GROUP BY `no` HAVING selectCount > 1 ORDER BY selectCount asc
update by_user_no inner join (select uid,no,mobile,nickname, from_unixtime(created_at), from_unixtime(updated_at) from by_user where no in (select no from (select no from by_user_no where uid = 0 limit 11) a)) c on by_user_no.no = c.no set by_user_no.uid = c.uid;