Wireless Sensor Networks (WSNs) are highly distributed networks consisting of a large number of tiny, low-cost, light-weight wireless nodes deployed to monitor an environment or a system. Each node in a WSN consists of three subsystems: the sensor subsystem which senses the environment, the processing subsystem which performs local computations on the sensed data, and the communication subsystem which is responsible for message exchange with neighboring sensor nodes. While an individual sensor node has limited sensing region, processing power, and energy, networking a large number of sensor nodes give rise to a robust, reliable, and accurate sensor network covering a wide region. Thus, routing in WSNs is a very important issue. This paper presents a query-based routing protocol for a WSN that provides different levels of Quality of Service (QoS): energy-efficiency, reliability, low latency and fault-tolerance-under different application scenarios. The algorithm has low computational complexity but can dynamically guarantee different QoS support depending on the requirement of the applications. The novelty of the proposed algorithm is its ability to provide multiple QoS support without reconfiguration and redeployment of the sensor nodes. The algorithm is implemented in network simulator ns-2 and its performance has been evaluated. The results show that the algorithm is more efficient than some of the currently existing routing algorithms for WSNs.