Handle where in query