# Multiple relationship filtering on a single call

**URL:** <https://community.dreamfactory.com/t/multiple-relationship-filtering-on-a-single-call/4875>\
**Category:** REST API\
**Created:** [April 7, 2019, 4:35am UTC](https://community.dreamfactory.com/t/multiple-relationship-filtering-on-a-single-call/4875 "2019-04-07T04:35:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bledileka](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/bledileka/32/1253_2.png) [@bledileka](https://community.dreamfactory.com/u/bledileka)\
**Post date:** [April 7, 2019, 4:35am UTC](https://community.dreamfactory.com/t/multiple-relationship-filtering-on-a-single-call/4875/1 "2019-04-07T04:35:08Z")

</div>

Hi everyone,

i am new to DF, trying to get around some standard sql queries like:

`select id from table1 where id IN (select anotherid from table2 where somerules) and id NOT IN (select someotherid from table3 where someotherurles)`

is there anyway to have this converted to df url filters ? If not what do you think is the best way to achieve the same result through DF rest api ?

I did try some virtual relationship and virtual fields but no luck so far.

Any help is appreciated.  
Thank you

---

<div class="post-metadata">

**Author:** ![abhishek.pandey](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@abhishek.pandey](https://community.dreamfactory.com/u/abhishek.pandey)\
**Post date:** [June 12, 2020, 5:29pm UTC](https://community.dreamfactory.com/t/multiple-relationship-filtering-on-a-single-call/4875/2 "2020-06-12T17:29:46Z")

</div>

The best way to achieve this is by using the Data Mesh feature as you already mentioned. You can refer to this guide - [https://blog.dreamfactory.com/easier-data-marts-with-dreamfactory-data-mesh/](https://blog.dreamfactory.com/easier-data-marts-with-dreamfactory-data-mesh/)

Also, you could also add certain conditions in the API call itself. Look at the documentation here - [https://guide.dreamfactory.com/docs/chapter03.html#generating-a-mysql-backed-api](https://guide.dreamfactory.com/docs/chapter03.html#generating-a-mysql-backed-api).

Doing the above will result in only call one API endpoint to achieve the desired results. Let me know if it helps
