The error didn't come from a broken SQL query, but from a "try to submit an already submitted survey" …
For me it's happen with a plugin. But i have it on another system without plugin and i don't find how exactly this happen (don't find the way to reproduce).
Maybe a potential reproduct step
1. Start survey on browser #1 (get 1st question at minimum)
2. Start survey on browser #2 (go to 1st group, didn't submit)(maybe check with just welcome page)
3. Submit survey in browser #1 : survey submitdate is set
4. Try to move next on browser #2 : the error can happen.
If you can reproduce the issue with such step. And can check on demo.limesurey.org : please report the issue

.