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 users ( id int not null primary key, group_id int not null, invited_by_user_id int not null, name varchar(50) not null, posts_qty int not null ); insert into users (id, group_id, invited_by_user_id, name, posts_qty) values (1, 1, 0, 'Пользователь 1', 0), (2, 1, 1, 'Пользователь 2', 2), (3, 1, 2, 'Пользователь 3', 5), (4, 2, 3, 'Пользователь 4', 7), (5, 2, 4, 'Пользователь 5', 1); select * from users order by posts_qty desc limit 1;

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

Copy Clear