简体   繁体   中英

SQL Select inner join from (Select inner join)?

Hi I try to select data inner join from inner join from another table (It weird when I say it without example,that why I didn't get any result from Google). this is my Database.

My Database flowchart Picture

I want to select Product_Total.Product_Name from Product_Total instant of Product_Id in table Product_Customer

| Barcode_Id  | Product_Name  | Sub_Id  | Department_Name | Status |
--------------------------------------------------------------------
| KS4815874   | DELL Server   | S47811  | Store Main Unit | Spare  |

Select Product_Name inner join Product_Customer.Product_Id = Product.Product_Id then inner join Product.Product_Id_T = Product_Total.Product_Id_T 

but how I can write it in sql command

and if i want to select some data from all the table using select join [or other option],how can i do it??

Select Project_Name,Project_Detail,PR_Id,PO,PO_Date,Delivery_Id,Delivery_Date,Brand_Name,Product_Name,EQ,Price_PerUnit,etc... (very long)

the inner join is produce a new virtual table with the rows according to the ON condition

so you can do as much as you want from inner join

select ...... 

from table1 inner join table2 on table1.id = table2.id // produce a new table 
            inner join table3 on table2.id = table3.id
            and so on .....

so after the first inner join :

table1     * table2                           table3 
**********************    inner join with    ********
column...  * column...                        column...     

after the second inner join:

table1      *      table2      *    table3
*******************************************
column...   *   column...      *    column...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM