65
There is a free online Instant SQL Formatter. The site also sells some other versions (add-in for Visual Studio, for example), but the online version is free.
Sequel Pro if using OS X.
Otherwise, just work out what you need, and then develop your query using your knowledge and use the command line tool (my personal favourite:)).