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 tbl ( col1 int, col2 int, col3 int ); insert into tbl (col1, col2) values (1, 12), (1, 32), (2, 10), (2, 5), (3, 6), (3, 10); update tbl join ( select col1, sum(col2) col2_sum from tbl group by col1 ) summed on summed.col1 = tbl.col1 set col3 = col2_sum; select * from tbl;

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

Copy Clear