# \#sql

**URL:** https://community.openhab.org/tag/sql/5133.md

[Latest](https://community.openhab.org/latest.md) · [Categories](https://community.openhab.org/categories.md) · [Tags](https://community.openhab.org/tags.md)

---

## [One pass SELECT to compute the difference between 2 item tables](https://community.openhab.org/t/one-pass-select-to-compute-the-difference-between-2-item-tables/163251)

<div class="topic-metadata">

**Author:** [@narc-Ontakac2](https://community.openhab.org/u/narc-Ontakac2)\
**Replies:** 0\
**Last updated:** [March 22, 2025, 4:43pm UTC](https://community.openhab.org/t/one-pass-select-to-compute-the-difference-between-2-item-tables/163251 "2025-03-22T16:43:50Z")

</div>

I am using Postgresql and Grafana for monitoring. One thing I frequently need is the power consumption, which in my case is the difference between my power meter values (coming from vzlogger) and the power from 2 solar p…
