[英]SQL Select inner join from (Select inner join)?
嗨,我尝试从另一个表的内部联接中选择数据内部联接(当我不带示例地讲时,这很奇怪,这就是为什么我没有从Google得到任何结果的原因)。 这是我的数据库。
我想从表中的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
但是我怎么能在sql命令中写
如果我想使用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)
内部联接是根据ON条件生成带有行的新虚拟表
这样您就可以通过内部联接做任意多的事情
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 .....
所以在第一次内部联接之后:
table1 * table2 table3
********************** inner join with ********
column... * column... column...
在第二个内部联接之后:
table1 * table2 * table3
*******************************************
column... * column... * column...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.