https://github.com/bsvingen/sql-indent.git
git clone 'git://github.com/bsvingen/sql-indent.git'
This is sql-indent for Emacs.
It was originally written by Alex Schroeder, and used to live on emacswiki.org.
Usage note:
Loading this file will make all SQL mode buffers created from then on use `sql-indent-line' for indentation. A possible way to install sql-indent.el would be to add the following to your .emacs:
(eval-after-load "sql"
'(load-library "sql-indent"))