简体   繁体   English

SQL从(选择内部联接)中选择内部联接?

[英]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). 嗨,我尝试从另一个表的内部联接中选择数据内部联接(当我不带示例地讲时,这很奇怪,这就是为什么我没有从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 我想从表中的product_id的Product_Total即时选择Product_Total.Product_Name 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 但是我怎么能在sql命令中写

and if i want to select some data from all the table using select join [or other option],how can i do it?? 如果我想使用select join [或其他选项]从所有表中选择一些数据,该怎么办?

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 内部联接是根据ON条件生成带有行的新虚拟表

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...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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