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

SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular

SQLize.online is a free online SQL environment for quickly running, experimenting with and sharing code. You can run your SQL code on top of the most popular RDBMS including MySQL, MariaDB, SQLite, PostgreSQL, Oracle and Microsoft SQL Server.

Copy Format Clear
-- Hint: use Ctrl+Enter for SQL autocomplete create table table1 ( name varchar(32) primary key, total int, price int ); insert into table1 values ('A', NULL, 5), ('B', NULL, 5), ('C', NULL, 5); create table table2 ( total2 int ); insert into table2 values (15), (1), (5); UPDATE table1 JOIN ( SELECT name, total2, ROW_NUMBER() OVER () AS rn FROM table1 JOIN table2 ORDER BY name ) AS t ON table1.name = t.name SET table1.total = t.total2; SELECT * FROM table1;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear