嗨,我尝试从另一个表的内部联接中选择数据内部联接(当我在没有示例的情况下说它时,这很奇怪,这就是为什么我没有从谷歌获得任何结果)。 这是我的数据库。
我想从表 Product_Customer 中 Product_Id 的 Product_Total 实例中选择 Product_Total.Product_Name
| 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...
关于mysql - SQL 选择内连接来自(选择内连接)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22057369/