# Best way to compare SQL query results in Dynatrace once per day?

**URL:** <https://community.dynatrace.com/t/best-way-to-compare-sql-query-results-in-dynatrace-once-per-day/53822>\
**Category:** Open Q&A\
**Created:** [October 22, 2025, 12:00pm UTC](https://community.dynatrace.com/t/best-way-to-compare-sql-query-results-in-dynatrace-once-per-day/53822 "2025-10-22T12:00:10Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![EmmaT](https://avatars.discourse-cdn.com/v4/letter/e/4bbf92/32.png) [@EmmaT](https://community.dynatrace.com/u/EmmaT)\
**Post date:** [October 22, 2025, 12:00pm UTC](https://community.dynatrace.com/t/best-way-to-compare-sql-query-results-in-dynatrace-once-per-day/53822/1 "2025-10-22T12:00:10Z")

</div>

Hi everyone,

We have a need to run a specific SQL query once a day, wait a few minutes, and then run the same query again. If the two results are _identical_, it indicates that something isn’t working as expected, and we need to trigger an alert to a team.

Example workflow:

- Run the query at 8:00 AM
- Wait 5 minutes
- Run it again at 8:05 AM
- If both results are the same, send an alert
- Then do nothing until the next day

I was thinking of doing this with Python and storing the first result in a variable and then using time.sleep()&nbsp;wait, running the query again, and comparing the results.

Would that approach make sense, or is there a better / more Dynatrace-native way to handle this kind of scheduled comparison and alerting?

Thanks in advance for any suggestions!

---

_[View the full topic](https://community.dynatrace.com/t/best-way-to-compare-sql-query-results-in-dynatrace-once-per-day/53822)._
