SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table t( sales int); insert into t values(1), (2), (3), (4), (5), (6); select top 1 * from (select a.sales, sum(b.sales) cum_sum from t a left join t b on a.sales>=b.sales group by a.sales) k where cum_sum>=7 order by cum_sum ; create procedure p1() as select * from t; exec p1

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear