technical skills grow

Responsive Ads Here

Monday, January 4, 2021

MySQL INSERT ON DUPLICATE KEY UPDATE

 

 INSERT INTO  PAYOUT_DATA
(STATION_ID ,DATA_DATE ,MIN_TEMP ,MAX_TEMP  ,RAIN ,MIN_RH  ,MAX_RH  ,MAX_WIND)
 -- VALUES (
 select STATION_ID ,DATADATE ,MINTEMP,MAXTEMP ,AvgRAIN ,17_30Humidity,8_30Humidity,WSMax
 from DAILY_DATA  where STATION_ID>0
ON DUPLICATE KEY UPDATE
 MIN_TEMP=daily_summary_data_2020.MINTEMP,
 MAX_TEMP=daily_summary_data_2020.MAXTEMP,
 RAIN =daily_summary_data_2020.AvgRAIN,
 MIN_RH=daily_summary_data_2020.17_30Humidity,
 MAX_RH= daily_summary_data_2020.8_30Humidity,
 MAX_WIND=daily_summary_data_2020.WSMax ;

No comments:

Post a Comment

Powered by Blogger.

Labels

Contact Form

Name

Email *

Message *

Search This Blog

Blog Archive

Ad Code

Responsive Advertisement

Recent Posts