I was playing around with MySQL Workbench earlier in the week, and ran across the “clean up SQL” feature, which I thought was neat. Here’s a picture-based demonstration – you can click on the pictures to make them bigger, so they are more readable.
Simply click the “broom” icon and watch as your SQL is cleaned
up, with one field in the SELECT per line and the JOINs indented
and formatted prettily: