Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

MYSQL how to update the ship amount for the order dates after 2015-03-30 15:22:31 to 15

I’m having trouble with this question: Write an UPDATE statement that modifies the Orders table. Change all ship amount for order dates after 2015-03-30 15:22:31 to 15. If you get an error due to safe-update mode, you can add a LIMIT clause to update the first 100 rows of the table. (This should update all rows in the table.)

I’ve written it like this:

UPDATE orders
SET ship_amount = 15
WHERE order_date = 2015-03-30 15:22:31
LIMIT 100;

but I’m getting an error in the where clause and I’m using the my_guitar_shop schema

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The date value 2015-03-30 15:22:31 should written under ” single cotes.

UPDATE order_details SET add_by_admin = 15 WHERE created_at > '2022-02-09 18:44:01' LIMIT 100

eg.

UPDATE orders
SET ship_amount = 15
WHERE order_date > '2015-03-30 15:22:31'
LIMIT 100;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading