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 ); insert into tbl (col1, col2) values (1, 12), (1, 32), (2, 10), (2, 5), (3, 6), (3, 10); CREATE VIEW tbl_sum AS SELECT tbl.*, SUM(tbl.col2) OVER (PARTITION BY tbl.col1) AS col3 FROM tbl; SELECT * FROM tbl_sum;

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

Copy Clear