-1

There is a table oc_product with products, you need to delete all products the date of addition and modification is younger than 2022. Table names oc_product Columns: date_added, date_modified

I really need help please.

DELETE FROM `oc_product` WHERE  WHERE 'date_added'='0000-00-00 00:00:00'

DELETE FROM `oc_product` WHERE [date_modified: 0000-00-00 00:00:00 - 0000-00-00 00:00:00]

Tried variations of these queries, but my knowledge is not enough. Help me please.

Barmar
  • 741,623
  • 53
  • 500
  • 612
vasiliy
  • 1
  • 2

1 Answers1

0

Use < to make a less-than comparison.

Don't quote column names. See When to use single quotes, double quotes, and backticks in MySQL.

Compare with 2022-01-01, not 0000-00-00.

DELETE FROM oc_product
WHERE date_added < '2022-01-01' AND date_modified < '2022-01-01'
Barmar
  • 741,623
  • 53
  • 500
  • 612