richardycc
Diamond Member
I am trying to create a query to get the results from a few tables, but I think the best way to do this is to create a temp table, then query this temp table. The data structures are like this:
Table 1
Columns: Customer_name, record_key, some other columns that I dont care
Table 2
Columns: Record_key, table1_record_key, some other columns
Table 3
Record_key, table2_record_key, details, some other columns
So I need to either come up with a query to give me the customer name from table 1 and details from table 3.
I have a query with some nested sub selects, it works, but it will only return me the info from table 3 without the customer_name, because table 3 doesn't have that info.
So I think I can create a temp and insert the data from each table individually.
I will first create the temp table with columns customer_name, table1_record_key, table2_record_key, table3_record_key, details
And insert the 2 columns from table 1 into this temp table, but what does the 2nd query look like to insert the data from table 2 where table1_record_key = record_key?
Table 1
Columns: Customer_name, record_key, some other columns that I dont care
Table 2
Columns: Record_key, table1_record_key, some other columns
Table 3
Record_key, table2_record_key, details, some other columns
So I need to either come up with a query to give me the customer name from table 1 and details from table 3.
I have a query with some nested sub selects, it works, but it will only return me the info from table 3 without the customer_name, because table 3 doesn't have that info.
So I think I can create a temp and insert the data from each table individually.
I will first create the temp table with columns customer_name, table1_record_key, table2_record_key, table3_record_key, details
And insert the 2 columns from table 1 into this temp table, but what does the 2nd query look like to insert the data from table 2 where table1_record_key = record_key?