Recently there have been growing interests in the applications of wireless sensor networks. Given a query point, which is a value, find a set of K nodes whose values are nearest to this point. We call this query the value-based KNN (v-KNN) query. v-KNN is a challenging query in wireless sensor networks because the network is highly distributed and global knowledge of the values are needed before the result set could be constructed. In this paper, we propose a new algorithm called KVC (v-KNN queries based on value clustering ) to process the v-KNN queries in wireless sensor networks in an energy efficient way. KVC takes advantage of the rich resources in the base station to do some optimizations to filter the irrelevant nodes and push down the v-KNN query into the network. The aim of KVC is to reduce the total communication cost as much as possible while processing the v-KNN queries correctly and efficiently. Simulation results on both realistic and synthetical data sets show that KVC outperforms the central processing in both average and hotspot energy consumption in wireless sensor networks.