Skip to content
Advertisement

Using arithmetic operators and/or brackets in a LIMIT clause

I have the following small subquery in query in stored procedure.

But there is the syntax error:

“(” is not valid at this position, expecting an identifier

So, the question is: do I have a possibility to use brackets and/or arithmetic operators in LIMIT clause?

Documentation says I can use local variables in LIMIT clause within stored procedure. Do I really need to declare and set different variables for this case?

Just in case, link for the code of stored procedure.

Advertisement

Answer

You can’t do arithmetic at that point

So do instead

Which will produce

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement