# Issue in Advanced Sync Rules for JOIN Query

**URL:** <https://discuss.elastic.co/t/issue-in-advanced-sync-rules-for-join-query/349605>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [December 19, 2023, 1:47am UTC](https://discuss.elastic.co/t/issue-in-advanced-sync-rules-for-join-query/349605 "2023-12-19T01:47:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aisyaharifin](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aisyaharifin](https://discuss.elastic.co/u/aisyaharifin)\
**Post date:** [December 19, 2023, 1:47am UTC](https://discuss.elastic.co/t/issue-in-advanced-sync-rules-for-join-query/349605/1 "2023-12-19T01:47:12Z")

</div>

Hi Elastic,

I have a question to ask where I've encountered issue with the Advanced Sync Rules Query :

 ![Screenshot 2023-12-19 at 9.32.33 AM](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a4e7346952c3ecafb719fc098f89d02cc0efcaa.png)

So I have an application lets call it myStaff, where I've been pulling multiple tables from the db using Microsoft SQL Connectors. As I need to JOIN multiple tables, I face blocker in doing the JOIN query using the Advanced rules.

I notice from the docker logs that it keep skipping my custom query :

 ![Screenshot 2023-12-18 at 10.09.27 AM](https://us1.discourse-cdn.com/elastic/original/3X/f/c/fc0be998a3262dffc44e765ca64dad6fc7ded9a1.png)

As I construct any other rules than the JOIN rules, its working.  
Even I tried the simplest JOIN couldn't works the query.  
Below is one of the example query :

```auto
{
    "tables": [
      "Post",
      "Channel"
    ],
    "query": "SELECT TOP 100 P.id as PostID, C.id as ChannelID from Post P INNER JOIN Channel C ON C.Id = P.ChannelId where C.IsDeleted ='0' and C.isPrivate ='0' and P.IsDeleted ='0'"
  },

```

I've already checked with the technical team on the queries and everything works from their side. When they test the query. Is there any issue with the JOIN query?  
I've been looking into this reference for the query and I'm already in 8.11.1 ver of Elastic :  
[https://www.elastic.co/guide/en/enterprise-search/8.11/connectors-ms-sql.html#connectors-ms-sql-sync-rules-example-one-join](https://www.elastic.co/guide/en/enterprise-search/8.11/connectors-ms-sql.html#connectors-ms-sql-sync-rules-example-one-join)

Need help with this, thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 16, 2024, 1:47am UTC](https://discuss.elastic.co/t/issue-in-advanced-sync-rules-for-join-query/349605/2 "2024-01-16T01:47:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
