Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table products ( id int, product_id int, warehouse_id int, quantity int ); create table products_history ( id int, product_id int, warehouse_id int, quantity int, history_date date, primary key (product_id, warehouse_id, history_date) ); insert into products_history select products.*, current_date from products on duplicate key update set quantity = values(quantity);

Stuck with a problem? Got Error? Ask AI support!

Copy Clear