# Custom SQL Data Asset

**URL:** <https://discourse.greatexpectations.io/t/custom-sql-data-asset/1999>\
**Category:** GX Core Support\
**Created:** [November 18, 2024, 4:37pm UTC](https://discourse.greatexpectations.io/t/custom-sql-data-asset/1999 "2024-11-18T16:37:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edunn](https://avatars.discourse-cdn.com/v4/letter/e/278dde/32.png) [@edunn](https://discourse.greatexpectations.io/u/edunn)\
**Post date:** [November 18, 2024, 4:37pm UTC](https://discourse.greatexpectations.io/t/custom-sql-data-asset/1999/1 "2024-11-18T16:37:41Z")

</div>

I am trying to run some expectations on a table - these expectations reference more than one table (example - table a column a only has values that exist in table b column b) is there a way to do this natively within great expectations.

Moreover I would like to create custom data assests using SQL joins is there a way to do this?

---

<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:** [November 20, 2024, 5:32pm UTC](https://discourse.greatexpectations.io/t/custom-sql-data-asset/1999/2 "2024-11-20T17:32:36Z")

</div>

Hello! You can use a join in `UnexpectedRowsExpectation` and it will work as long as the joined table is accessible using the credentials known by the Data Asset. More info [here](https://docs.greatexpectations.io/docs/core/customize_expectations/use_sql_to_define_a_custom_expectation)
