# Create a Table From Query Builder

**URL:** <https://forums.toadworld.com/t/create-a-table-from-query-builder/57321>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [April 12, 2023, 12:19pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321 "2023-04-12T12:19:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![srh5428](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@srh5428](https://forums.toadworld.com/u/srh5428)\
**Post date:** [April 12, 2023, 12:19pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321/1 "2023-04-12T12:19:47Z")

</div>

Hello,

Very new to Toad and data in general so please forgive my ignorance. I am used to Microsoft Access where I can drag and drop tables and create relationships and have Access create a static table off a query I built. I am trying to do the same thing in Toad for Oracle but am having trouble. I have my query built the way I like it, but can't find a simple way to export my query to a table in order to reference that table in another query.

For example, this is my generated query:

 ![image](https://global.discourse-cdn.com/quest/original/2X/f/f35cf6aad3b45fc840d8787afb10c8c64619f4a0.png)

I want to be able to reference that table in another query and eventually export my "master query" to Excel.

Please help, thank you.

- Seth -

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [April 12, 2023, 12:37pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321/2 "2023-04-12T12:37:00Z")

</div>

Query Builder aside, you could create a view.

Create or replace view my\_awesome\_view as  
select something complicated  
from some\_table;

Then you can select from my\_awesome\_view as if it were a table.

---

<div class="post-metadata">

**Author:** ![srh5428](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@srh5428](https://forums.toadworld.com/u/srh5428)\
**Post date:** [April 12, 2023, 1:09pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321/3 "2023-04-12T13:09:09Z")

</div>

Thanks for the quick response, John.

Could you please explain how to create a view? I am still going through the free Toad lessons and I am getting there, but I would honestly probably need this explained to me like I am 10.

Here is my canvas:

 ![image](https://global.discourse-cdn.com/quest/original/2X/b/b24da9eb01081671a8fe08d32b03471ca11f78f8.png)

End goal is this: Those values in the original Query Results I sent should be constantly being updated. I will be adding other data to further expand the query, but that data is available in other tables that I need to link later on.

If I can get Toad to continually update the data from this query and create this as an autoupdating table, I would then like to create another query linking other raw data to this previously created query where I only show those specific parameters I would like to see.

Does that make sense?

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [April 12, 2023, 1:17pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321/4 "2023-04-12T13:17:12Z")

</div>

Hi Seth.

A view is a "continually updating table". It basically just stores your query in the database and then you can reference it by name. So its data will always be up to date with the underlying tables.

You can click here to create a view from what you have so far, then start query builder fresh and then you can can join things to my\_awesome\_view rather than deal with the SQL to that you needed to create it.

 ![image](https://global.discourse-cdn.com/quest/original/2X/f/fbf12bb420762318c0995e9c43daa7900f08c7e4.png)

---

<div class="post-metadata">

**Author:** ![srh5428](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@srh5428](https://forums.toadworld.com/u/srh5428)\
**Post date:** [April 12, 2023, 1:47pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321/5 "2023-04-12T13:47:36Z")

</div>

Thanks for explaining John, that worked!

As a follow up question: Is there a way to have the view not stored on the database, but elsewhere?

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [April 12, 2023, 3:09pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321/6 "2023-04-12T15:09:13Z")

</div>

No, but you can make a subquery instead of a view. I believe you can do this with the query builder, but to be honest I'm not exactly sure how. In pure SQL, it would look like this:

```auto
with empdept as
     (select e.ename, e.empno, e.job, d.loc 
      from emp e, dept d
      where e.deptno = d.deptno)
select * 
from empdept; -- you could join something else to empdept here if you want.

```

---

<div class="post-metadata">

**Author:** ![srh5428](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@srh5428](https://forums.toadworld.com/u/srh5428)\
**Post date:** [April 12, 2023, 4:45pm UTC](https://forums.toadworld.com/t/create-a-table-from-query-builder/57321/7 "2023-04-12T16:45:36Z")

</div>

Ok thank you, John. I appreciate your replies!
