IMHO editor is designed for string filtering '1984', not for integer filtering 1984. It is good only for basic queries. If you need more complex queries (e.g. subqueries), then you need to switch to the text edit mode, what will be useful also your use case.
Thank you jangaraj for quick replay.
Anyway, the problem is that even if I use text editor to correct the query, after coming back to standard view (Query editor), at first zoom in or out, or at first time range adjusting, the char " ’ " comes back.
I personally regard this as highly undesirable behaviour in Grafana - not
quite a bug, but close.
Basically, if you ever switch to manual edit mode for a query and change
something, you must never switch back to the “standard view” as you call it,
otherwise all your work will be undone.