MySQL Workbench “Clean up SQL” Feature

Sheeri

2

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.

Here is a typical complex query that looks pretty good formatted in the results from a performance schema query:
query from performance schema

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:
nicer, cleaned up SQL

Pretty cool, for just the click of a button!

2 responses

  1. Justin Swanhart wrote on :

    sqlfiddle.com will let you play with lots of different databases (mysql, oracle, mssql) and it can format your SQL for you too.

  2. NA wrote on :

    During development you use Workbench not sqlfiddle.