# Expect\_table\_row\_count\_to\_equal\_other\_table

**URL:** <https://discourse.greatexpectations.io/t/expect-table-row-count-to-equal-other-table/999>\
**Category:** Archive\
**Created:** [February 28, 2022, 4:52pm UTC](https://discourse.greatexpectations.io/t/expect-table-row-count-to-equal-other-table/999 "2022-02-28T16:52:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madi](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@Madi](https://discourse.greatexpectations.io/u/Madi)\
**Post date:** [February 28, 2022, 4:52pm UTC](https://discourse.greatexpectations.io/t/expect-table-row-count-to-equal-other-table/999/1 "2022-02-28T16:52:49Z")

</div>

Hello,

I am trying to use expect\_table\_row\_count\_to\_equal\_other\_table to define an expectation that compare the number of rows of two tables, but i can’t find the right syntax.

Can anybody help me please?

Here are some details

1 - the purpose: i am trying to figure out if all the rows of the table raw\_dv\_sch.a exist in the table gold\_sch.b.

2- First i prepared my test in my checkpoint file:

- batch\_request:  
data\_connector\_name: default\_runtime\_data\_connector\_name  
data\_asset\_name: id\_test\_27  
runtime\_parameters:  
query: |  
with  
ge\_27\_1 as ( select distinct a\_md5 from raw\_dv\_sch.a),  
ge\_27\_2 as (select distinct b\_md5 from gold\_sch.b)  
select ge\_27\_1.a\_md5 from  
ge\_27\_1 inner join ge\_27\_2 ON ge\_27\_2.b\_md5 = ge\_27\_1.a\_md5 default\_identifier\_name: ge\_27  
expectation\_suite\_name: test\_5

3- then in my terminal i execute this command: great\_expectations --v3-api suite edit test\_5

4- knowing that raw\_dv\_sch.a has 80 rows and the table ge\_27 has 70 rows

5- When i use this expectation function to compare the number of lines between my table ( the result of th query) and the table ge\_27\_1 :  
batch.expect\_table\_row\_count\_to\_equal\_other\_table (self= “ge\_27”, other="ge\_27\_1 ")

i get this result:  
{  
“exception\_info”: {  
“raised\_exception”: false,  
“exception\_traceback”: null,  
“exception\_message”: null  
},  
“success”: true,  
“meta”: {},  
“result”: {  
“observed\_value”: {  
“self”: 70,  
“other”: 70  
}  
}  
}

I don’t understand the result and i am not sure if the syntaxe is correct or no !

Thank you in advance for your help
