Removed duplicate code from `Db\Query\Select`

Improve complex test for `Db\Query\Select`