add selectQuery method

I added this method to enable more advanced select queries.