# How to create Expectation to compare 2 query results?

**URL:** <https://discourse.greatexpectations.io/t/how-to-create-expectation-to-compare-2-query-results/1944>\
**Category:** GX Core Support\
**Tags:** how-to\
**Created:** [October 10, 2024, 8:15pm UTC](https://discourse.greatexpectations.io/t/how-to-create-expectation-to-compare-2-query-results/1944 "2024-10-10T20:15:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hg.inn](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@hg.inn](https://discourse.greatexpectations.io/u/hg.inn)\
**Post date:** [October 10, 2024, 8:15pm UTC](https://discourse.greatexpectations.io/t/how-to-create-expectation-to-compare-2-query-results/1944/1 "2024-10-10T20:15:22Z")

</div>

Hello,

I want to know how to create custom Expectation to compare 2 query results? Is there a tutorial I can watch applicable for GECore v1.1.1?

Thanks!

---

<div class="post-metadata">

**Author:** ![adeola](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@adeola](https://discourse.greatexpectations.io/u/adeola)\
**Post date:** [October 18, 2024, 3:43pm UTC](https://discourse.greatexpectations.io/t/how-to-create-expectation-to-compare-2-query-results/1944/2 "2024-10-18T15:43:19Z")

</div>

Unfortunately, there is not a tutorial for this specific custom expectation you are wishing to implement, however this section in our [docs](https://docs.greatexpectations.io/docs/core/customize_expectations/use_sql_to_define_a_custom_expectation) outlines the process of inheriting the class of an existing expectation. From there you may use SQL to write the logic to compare 2 query results.
