In this query i want to update those records which is latest posted.But my this query is not working please help me what the reason ???
Error :--You can't specify target table 'beevers_products' for update in FROM clause
update beevers_products set product_name='my_product_name' where posted_date in (SELECT posted_date FROM `beevers_products` order by posted_date asc limit 1)
Check this:
UPDATE beevers_products
SET product_name = 'my_product_name'
WHERE posted_date = (SELECT posted_date
FROM beevers_products
ORDER BY posted_date DESC limit 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With