In HeidiSQL MySQL client you can save queries that you use often. All you need to use a query again and again is save it as a snippet.
First, go to Tools -> Preferences menu item
In Preferences window, specify custom snippets directory. I recommend to use a cloud storage to save your snippets to share them between computers and save if your hard drive will break.
Then write your query and save it as a snippet in “File -> Save as snippet” menu item. Use meaningful snippet file name – it will appear in snippets list.
Now you can insert the query just in few clicks. Check right-side panel, expand “Snippets” folder and double click the query you need.