distal-attribute
distal-attribute
distal-attribute
distal-attribute

New feature: Reformat SQL

User, date Message
Written by ansgar
5 years ago
Category: News
4936 posts since Fri, 07 Apr 06
We've all been there: Getting some totally unreadable portion of SQL queries from someone else's code, and you are hard working to find the logic in order to understand it. Now, HeidiSQL can reformat such SQL, so it gets readable again. Just press the relevant button on the main toolbar:


Example code, before reformatting:

select * # select
from bla join bla on b=1 left
join blub on /* big comment select */ b.ud = udfu
where biuaosdi=1 and concat( a , 'das' ) like date_sub(now(), interval 1 day)
order ' concat () ' # select
by rand() group by askdhja limit 10, 199



... and after reformatting:

SELECT * # select
FROM bla
JOIN bla ON b=1
LEFT JOIN blub ON /* big comment select */ b.ud = udfu
WHERE biuaosdi=1 AND CONCAT(a, 'das') LIKE DATE_SUB(NOW(), INTERVAL 1 DAY)
ORDER ' concat () ' # select
BY RAND()
GROUP BY askdhja
LIMIT 10, 199

 

Please login to leave a reply, or register at first.