SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table t ( id int, a int, b int, c int ); insert into t values ( 8 , 3 , 2 , 1 ), ( 9 , 3 , 2 , 1 ), ( 10 , 4 , 2 , 2 ); with data as (select id, a, b, c, row_number() over (partition by a,b order by id) rn from t ) select id,a, b, c from data where rn = 1;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear