MySQL Forums
Forum List  »  Newbie

Re: Unable to get Last Record..
Posted by: Julianna Fruin
Date: May 30, 2017 11:47AM

Thank you so much, Peter!

// This returns an error, stating [[You can't specify target table 'd' for update in FROM clause]]


update tdds.discrete_data d
set d.dd_auto_purge=1
where d.dd_acquired_ts < (
SELECT Max(dd_acquired_ts)
FROM tdds.discrete_data
where dd_acquired_ts < 1493152486000
)
ORDER BY d.dd_acquired_ts asc
LIMIT 100000;


Wouldn't it be something like this? it doesn't return an error, but extremely slow..

update tdds.discrete_data d
set d.dd_auto_purge=1
where d.dd_acquired_ts < (
SELECT Max(d.dd_acquired_ts)
FROM tdds.discrete_data d
where d.dd_acquired_ts < 1470316338269
ORDER BY d.dd_acquired_ts asc
LIMIT 100000) ;

Please advise.

Options: ReplyQuote


Subject
Written By
Posted
Re: Unable to get Last Record..
May 30, 2017 11:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.