# 1 query 2 separate tables

**URL:** <https://forum.djangoproject.com/t/1-query-2-separate-tables/16919>\
**Category:** ORM\
**Created:** [November 10, 2022, 6:24am UTC](https://forum.djangoproject.com/t/1-query-2-separate-tables/16919 "2022-11-10T06:24:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![satdownready](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/satdownready/32/8293_2.png) [@satdownready](https://forum.djangoproject.com/u/satdownready)\
**Post date:** [November 10, 2022, 6:24am UTC](https://forum.djangoproject.com/t/1-query-2-separate-tables/16919/1 "2022-11-10T06:24:43Z")

</div>

Good morning.

I have a django project. I have 2 seperate tables which have completely different headers.

How do i use 1 search query for both tables ?

Is it something similar to .union ?

Thanks

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 10, 2022, 12:16pm UTC](https://forum.djangoproject.com/t/1-query-2-separate-tables/16919/2 "2022-11-10T12:16:00Z")

</div>

I’m assuming that when you say:

> [@satdownready](#):
>
> completely different headers

you actually mean that they have different schemas - a different column structure.

> [@satdownready](#):
>
> How do i use 1 search query for both tables ?

You don’t.

Technically, even a union results in two queries being executed by the database.
