[MECHDB] Fixed grammar issues with compound select statements
[MECHDB] Refactored null check expressions