Rewrote select, now more consistent and with the possibility to juggle the AND and OR SQL conditionals