Compared with traditional stream processing, in a sensor network, the feature of data sources are distributed that we cannot centralize all the data into the root node. Therefore, the state-of-are process the query locally to reduce the network overhead and share the pressure of the root node. However, the current classification of window types does not fit sensor networks completely. We proposed 9 new window types with different window bound including local bound, holistic bound, and global bound that specific for the sensor network. And then the 9 window types are combined with decomposable function and non-decomposable function, which eventually produces two window types, the local window, and center window. For the local window, its window bound can be determined by the node itself, thus the node is able to aggregate data before transmitting data to the upper node. On other hand, in the global window, it is impossible to pre-calculate the data before every data centralized in the root node. Our approach for the local window is to do partial aggregation in both the local node and intermedia node. On the contrary, without doing aggregation in the global window, our approach only compresses and sort data where in the global window. When the scenario has to process multi-query into a distributed sensor network, we proposed DESMA algorithm, which tries to merge all the queries into a single query group. Afterward, the algorithm slices the query group into several sub-windows by the window bound of original queries. Thus, we are able to share the result of sub-windows in the case without re-calculating. Then, the node assembly the results of sub-windows that belong to the same query and send the final result to the upper node.