help mysql: how to delete data of a column from date to date

Post Reply
User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

help mysql: how to delete data of a column from date to date

Post by meteoesine » Tue Oct 04, 2022 6:18 am

Hello
please, how is the script to delete the data of the SM1 field from the extraData table, starting from the beginning to 30 sept 2022?
tnx in advance
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

davidefa
Expert
Expert
Posts: 862
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: help mysql: how to delete data of a column from date to date

Post by davidefa » Mon Oct 10, 2022 4:07 pm

If you mean the sql query to execute in phpmyadmin, you can use something like this:

Code: Select all

UPDATE alldataExtra SET SM1=NULL WHERE DateTime < '2022-09-30 00:00:00'
P.S.
A backup of the database is always a good idea, as these operations could be 'quite destructive'
Image

Post Reply