MySQL Forums
Forum List  »  Newbie

Re: Select from 1 Database - insert in other - only when a field contains...
Posted by: Peter Brawley
Date: October 24, 2016 01:07PM

Is this what you mean?

insert into statistic_db.history ( device,reading,value ) 
  select device, reading, value 
  from history 
  where timestamp < date_sub(now(), interval 1 day) and reading like '%temp%';

There's no aggregation in the query, so the Group By would just arbitrarily select rows; what's that about?

Options: ReplyQuote


Subject
Written By
Posted
Re: Select from 1 Database - insert in other - only when a field contains...
October 24, 2016 01:07PM


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.