# Doctrine QueryBuilder: how to join table from entity with table without entity?

**URL:** https://forums.concretecms.org/t/doctrine-querybuilder-how-to-join-table-from-entity-with-table-without-entity/2200
**Category:** Developing with Concrete
**Created:** [January 19, 2022, 7:09am UTC](https://forums.concretecms.org/t/doctrine-querybuilder-how-to-join-table-from-entity-with-table-without-entity/2200 "2022-01-19T07:09:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![linuxoid](https://forums.concretecms.org/user_avatar/forums.concretecms.org/linuxoid/32/5311_2.png) [@linuxoid](https://forums.concretecms.org/u/linuxoid)
#### Post date: [January 19, 2022, 7:09am UTC](https://forums.concretecms.org/t/doctrine-querybuilder-how-to-join-table-from-entity-with-table-without-entity/2200/1 "2022-01-19T07:09:13Z")

</div>

Does anyone know how to join with a QuiryBuilder a table created from a Doctrine entity class with simply a table from a database? I can only join entity tables, but not simple ones. Is this possible?

---

<div class="post-metadata">

### Author: ![mesuva](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mesuva/32/4014_2.png) [@mesuva](https://forums.concretecms.org/u/mesuva)
#### Post date: [January 19, 2022, 5:40pm UTC](https://forums.concretecms.org/t/doctrine-querybuilder-how-to-join-table-from-entity-with-table-without-entity/2200/2 "2022-01-19T17:40:35Z")

</div>

With the way that doctrine works, I don’t believe you ever actually do joins or queries directly on tables, it’s always done on the doctrine entities which behind the scenes _maps_ to the tables.

I think you either have to create an entity for your table, or revert back to doing a standard SQL query directly.

---

<div class="post-metadata">

### Author: ![linuxoid](https://forums.concretecms.org/user_avatar/forums.concretecms.org/linuxoid/32/5311_2.png) [@linuxoid](https://forums.concretecms.org/u/linuxoid)
#### Post date: [January 20, 2022, 12:21am UTC](https://forums.concretecms.org/t/doctrine-querybuilder-how-to-join-table-from-entity-with-table-without-entity/2200/3 "2022-01-20T00:21:58Z")

</div>

I was afraid so but was hoping I was wrong…
