queries:errors:syntax-errors

Syntax Errors

Syntax errors are mistakes in the syntax and should (or better not) occur when saving widgets or executing queries.

Could not understand draw query because of an unexpected token '...' instead of 'as'

This is a very common problem, especially from people coming from the SQL world. In DQL, you MUST specify an alternative column name IF it can't be determined automatically. For instance:

draw number using 1 - 2

This is not working, and must be changed like this:

draw number using 1 - 2 as value

The same rules apply to derived tables and sub queries.

Could not understand draw query because of an unexpected token 'using' instead of 'command type'

All draw queries must start with a “draw something” prefix. If this error occurs, it most likely means the draw prefix is missing. The query might look like this:

using 1 as value

instead of this:

draw number
using 1 as value