AllQuery.sql updated

Fixed syntax errors
Revert "AllQuery.sql updated"

This reverts commit 3fa312c3513743b6142f3c92c81dad16f1b4188d.