LANEXBUILDS
Playground
SQL Formatter
Beautify raw SQL queries.
Runs in your browser. Nothing is uploaded.
SQL
select u.id,u.name,count(o.id) as orders from users u left join orders o on o.user_id=u.id and o.status='paid' where u.active=1 and u.age>18 group by u.id,u.name having count(o.id)>1 order by orders desc limit 10;
Keywords
UPPERCASE
lowercase
Result
Copy result