# Nested Hubdb

**URL:** <https://community.hubspot.com/t/nested-hubdb/23651>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [July 31, 2020, 3:22pm UTC](https://community.hubspot.com/t/nested-hubdb/23651 "2020-07-31T15:22:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohansdeeson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rohansdeeson/32/2679_2.png) [@rohansdeeson](https://community.hubspot.com/u/rohansdeeson)\
**Post date:** [July 31, 2020, 3:22pm UTC](https://community.hubspot.com/t/nested-hubdb/23651/1 "2020-07-31T15:22:31Z")

</div>

So I have two HubDB Tables

One called experts one called expert\_reviews

expert reviews has a foreign table link to experts

I have my Hubl set up to get all the details for three random experts like so

```auto
{% for row in hubdb_table_rows("experts","&orderBy=random()&limit=3") %}

{{ row.name }}

{% endfor %}

```

etc but now I want to return 1 review from each returned expert but I’m not sure how to reference them I have tried something like this

```auto
{% for review in hubdb_table_rows("expert_reviews","expert={{row.sb_id}}&orderBy=random()&limit=1") %}
 {% endfor %}

```

but that doesn’t work can anyone give me any tips

---

<div class="post-metadata">

**Author:** ![Kevin-C](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kevin-c/32/34570_2.png) [@Kevin-C](https://community.hubspot.com/u/Kevin-C)\
**Post date:** [August 3, 2020, 9:37pm UTC](https://community.hubspot.com/t/nested-hubdb/23651/2 "2020-08-03T21:37:46Z")

</div>

Hey @rohansdeeson

[Might this article help?](https://designers.hubspot.com/tutorials/how-to-join-hubdb-tables)

Im sure you’ve seen it before, but if not I hope it helps!
