wrong:
mysql>
delete from sig_dumps
where date(created_on) < DATE_SUB(CURdate(), INTERVAL 7 DAY)
and id not in (
(select max(a.id)
from sig_dumps a
group by a.profile_id)
) ;
ERROR 1093 (HY000): You can't specify target table 'sig_dumps' for update in FROM clause
correct:
mysql>
delete from sig_dumps
where date(created_on) < DATE_SUB(CURdate(), INTERVAL 7 DAY)
and id not in
( select * from
(select max(a.id) from sig_dumps a group by a.profile_id) t
) ;
Query OK, 0 rows affected (0.02 sec)
Subscribe to:
Post Comments (Atom)
-
Step 1, New a project rails new demo Step 2, Update Gemfile add paperclip, mysql2 gem, enable JavaScript runtime gem 'mysql2' ...
-
Disk is out of space [root@reyotest stat]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 231825...
-
When trying to access transmission from web-browswer i got the message : 403: Forbidden Unauthorized IP Address. Either disable the IP ad...
No comments:
Post a Comment