Back to tools
SQL Formatter
Paste any SQL query to instantly format and beautify it with proper indentation and keyword casing.
Dialect
Input SQL285 bytes
Formatted300 bytes
SELECT u.id , u.name , u.email , COUNT (o.id ) AS order_count , SUM (o.total ) AS total_spent FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.created_at >= '2024-01-01' AND u.status = 'active' GROUP BY u.id , u.name , u.email HAVING COUNT (o.id ) > 0 ORDER BY total_spent desc LIMIT 50
Input Size
285 bytes · 44 tokens
Output Lines
7 lines
Dialect
Standard SQL