As a sql developer, DBA. we often post sql code on our blog. Take this sql for example,
select pub_name, count(qty) as orders, sum(qty) as total from sales inner join titles on (sales.title_id=titles.title_id) right join publishers on (publishers.pub_id=titles.pub_id) group by pub_name
It's really difficult for others to read. and how about this one after beautify previous sql:
Count(qty) AS orders,
Sum(qty) AS total
INNER JOIN titles
ON (sales.title_id = titles.title_id)
RIGHT JOIN publishers
ON (publishers.pub_id = titles.pub_id)
GROUP BY pub_name
Yes, it's really good for your readers.
Now, you can do this instantly with the help of a free online sql formatter:
1. Paste original sql code into input sql text box, then select corresponding database type, and...