# HubDb

**URL:** <https://community.hubspot.com/t/hubdb/64981>\
**Category:** CMS Development\
**Created:** [September 13, 2022, 11:59am UTC](https://community.hubspot.com/t/hubdb/64981 "2022-09-13T11:59:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MGheibi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mgheibi/32/75363_2.png) [@MGheibi](https://community.hubspot.com/u/MGheibi)\
**Post date:** [September 13, 2022, 11:59am UTC](https://community.hubspot.com/t/hubdb/64981/1 "2022-09-13T11:59:05Z")

</div>

Hello

I just have a question: I have two tables and I join them together. the first table can have many children in the second table(one to many), now I want to load the children of each parent(first table row) by parent’s ID. I mean that just the children of each parent load on the second linked page when I click on the parent name.

for example:

First table row: Germany

Second table row: Munich, Dusseldorf,…

I want when I click on Germany just load The Cities of Germany. Not all the rows in the second table.

Would you please help me?

Thanks

Maryam

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [September 13, 2022, 1:49pm UTC](https://community.hubspot.com/t/hubdb/64981/2 "2022-09-13T13:49:02Z")

</div>

Does the child table have a column that states the parent’s row ID so you can match cities with countries? If so, you would just filter by that, e.g.

```lia-code-sample
{% if dynamic_page_hubdb_row and row.hs_child_table_id %}
 {% set child_table = hubdb_table_rows(row.hs_child_table_id, "&country_id="~row.id ) %}
 {% for row in child_table %}
 {{row}}
 {% endfor %}
{% endif %}

```
