use 1 select query for multiple hashes