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 t (project int, id int[]); insert into t values (1, '{7, 7, 7}'); insert into t values (1, '{8, 8, 8}'); insert into t values (1, '{1, 11, 10}'); insert into t values (2, '{2, 22, 12}'); insert into t values (2, '{3, 33, 13}'); insert into t values (2, '{4, 44, 14}'); insert into t values (3, '{5, 55, 15}'); insert into t values (3, '{6, 66, 16}'); select *, dense_rank() over(partition by project order by id[3]) from t where id[3] > 10

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

Copy Clear