In this paper, we study the problem of processing multiple queries in a wireless sensor network. We focus on multiquery optimization at the base station level to minimize the number of radio messages in the sensor network. We adopt a cost-based approach, and develop a cost model to study the benefit of exploiting common subexpressions in queries. We also propose several optimization algorithms for both data acquisition queries and aggregation queries that intelligently rewrite multiple sensor data queries (at the base station) into “synthetic” queries to eliminate redundancy among them before they are injected into the wireless sensor network. The set of running synthetic queries is dynamically updated by the arrival of new queries as well as the termination of existing queries. We validate the effectiveness of our cost model and our experimental results indicate that our multi-query optimization strategy can provide significant performance improvements.