Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying different queries in the Query Builder. Is there a way to comment the query? I tried with

/* */



without success :

An error occurred when executing the query. The data provider said: OGR[3] error 1: SQL Expression Parsing Error: syntax error

EDIT : Thanks to the answer and comments of @Joseph,
I have made a feature request of this question: http://hub.qgis.org/issues/10914

share|improve this question
Welcome to GIS! Unless I'm mistaken, I don't think you can comment queries in the Query Builder. –  Joseph Jul 17 '14 at 12:18
Is there an other way to build queries then (and comment them as required ?) (Thx for editing, it looks much better) –  nebi Jul 17 '14 at 12:48

1 Answer 1

up vote 4 down vote accepted

You can build queries by using the Query Builder or an alternative is to use the Expression string builder (Layer Properties > Style > select Rule-based > add a rule > insert your command in the Filter box or click the '...' button to bring up the string builder interface.

In both cases, I do not think QGIS supports the comments function when creating expressions for filters/queries:


share|improve this answer
True, with this way you can save your rules and import / export them ... But it's not as quick as commenting with some symbol at the beginning of the line. Copy / paste in the query Builder is tedious –  nebi Jul 17 '14 at 13:58
@nebi, you could always send a request for this to be implemented in future updates. –  Joseph Jul 17 '14 at 14:11
Yes, I want to do it –  nebi Jul 17 '14 at 14:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.