Home
·
🗄 SQL Formatter
Standard SQL
MySQL
PostgreSQL
SQLite
T-SQL (SQL Server)
PL/SQL (Oracle)
BigQuery
UPPERCASE keywords
lowercase keywords
Preserve case
Indent:
2 spaces
4 spaces
8 spaces
Loading…
Input SQL
Minify
Clear
Sample
SELECT u.id,u.name,u.email,COUNT(o.id) as order_count,SUM(o.total) as total_spent,MAX(o.created_at) as last_order FROM users u LEFT JOIN orders o ON o.user_id=u.id LEFT JOIN user_profiles p ON p.user_id=u.id WHERE u.created_at>='2024-01-01' AND u.status='active' AND (u.role='customer' OR u.role='vip') GROUP BY u.id,u.name,u.email HAVING COUNT(o.id)>0 ORDER BY total_spent DESC LIMIT 50;
388 chars · 1 lines
Formatted SQL
Copy
Formatted SQL will appear here…
SELECT
INSERT INTO
UPDATE … SET
DELETE FROM
CREATE TABLE
ALTER TABLE
JOIN … ON
GROUP BY
HAVING
WINDOW … OVER
WITH … AS
EXPLAIN