# Join tables with foreign keys automatiically \[Apr 23\]

**URL:** <https://community.nocodb.com/t/join-tables-with-foreign-keys-automatiically-apr-23/388>\
**Category:** Discord-Discussions\
**Created:** [November 3, 2022, 9:01am UTC](https://community.nocodb.com/t/join-tables-with-foreign-keys-automatiically-apr-23/388 "2022-11-03T09:01:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 9:01am UTC](https://community.nocodb.com/t/join-tables-with-foreign-keys-automatiically-apr-23/388/1 "2022-11-03T09:01:08Z")

</div>

> 🙋‍♂️ **BoMBx** _asked_

## Hi, I have a question. Does nocodb join tables which have foreign keys automatically ? If yes, can I set if don’t want it to join automatically?

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 9:01am UTC](https://community.nocodb.com/t/join-tables-with-foreign-keys-automatiically-apr-23/388/2 "2022-11-03T09:01:09Z")

</div>

> 🙋‍♂️ **wkw** _replied_

#### Yes and No. Columns with LinkToAnotherRecord type will be created.

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 9:01am UTC](https://community.nocodb.com/t/join-tables-with-foreign-keys-automatiically-apr-23/388/3 "2022-11-03T09:01:10Z")

</div>

> 🙋‍♂️ **wkw** _replied_

#### Discussed with user in DM. Here’s the summary.

#### 

#### Question 1: Want to query a table in REST API call but excluding some fields

#### 

#### Ans: Using fields to determine which fields to show.

#### 

#### Example:

#### /api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}?fields= field\_name,field\_name2

#### 

#### Question 2: Query a table joining another table with some identical column names. Would it be any conflicts.

#### 

#### Answer:

#### 

#### In the returned json, the LinkToAnotherRecord data is presented in a nested way. For example, table A and table B both have a ManyToMany column.

#### In GUI, you will see TableBMMList in TableA and TableAMMList in Table B

#### if you call the api, you should see

#### 

#### {

#### field1: ‘xxx’,

#### field2: ‘xxx’,

#### TableAMMList: [{…}, {…}, {…}],

#### created\_by: ‘xxx’

#### }

#### 

#### Similarly, for HasMany column, it will be TableARead

#### 

#### {

#### field1: ‘xxx’,

#### field2: ‘xxx’,

#### TableARead: {…},

#### created\_by: ‘xxx’

#### }

#### 

#### so one can identify TableARead.field1 and field1

#

---

<div class="post-metadata">

**Author:** ![NocoDB](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@NocoDB](https://community.nocodb.com/u/NocoDB)\
**Post date:** [November 3, 2022, 9:01am UTC](https://community.nocodb.com/t/join-tables-with-foreign-keys-automatiically-apr-23/388/4 "2022-11-03T09:01:11Z")

</div>

[Autogenerated from discord](https://discord.com/channels/661905455894888490/966928425665323008)

* * *

#### Join [NocoDB’s](http://www.nocodb.com/) community

[Discord](https://discord.gg/5RgZmkW) • [Twitter](https://twitter.com/nocodb) • [Reddit](https://www.reddit.com/r/NocoDB/) • [Docs](https://docs.nocodb.com/)
