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 dashboards ( id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, company_id INT NULL, `order` TINYINT(1) DEFAULT 0 NOT NULL ); INSERT INTO dashboards (id, company_id, `order`) VALUES (1, 1, 0); INSERT INTO dashboards (id, company_id, `order`) VALUES (2, 2, 0); INSERT INTO dashboards (id, company_id, `order`) VALUES (3, 3, 0); INSERT INTO dashboards (id, company_id, `order`) VALUES (4, 4, 0); INSERT INTO dashboards (id, company_id, `order`) VALUES (5, 5, 0); INSERT INTO dashboards (id, company_id, `order`) VALUES (6, 6, 0); INSERT INTO dashboards (id, company_id, `order`) VALUES (7, 7, 0); INSERT INTO dashboards VALUES (8,8,1), (1,1,1), (2,5,1) ON DUPLICATE KEY UPDATE `order` = VALUES(`order`); SELECT * FROM dashboards;

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

Copy Clear