独立子查询
SELECT Cust_Name
FROM Customer_Details
WHERE Cust_ID
IN
(SELECT Cust_ID
FROM Customer_Loan)
AND Cust_ID IN
(SELECT Cust_ID
FROM Customer_Fixed_Deposit);
相关子查询
SELECT Cust_ID
FROM Customer_Details
WHERE Cust_ID
IN
(SELECT Cust_ID
FROM Customer_Loan
WHERE Customer_Loan.Cust_ID = Customer_Details.Cust_ID)
AND Cust_ID IN
(SELECT Cust_ID
FROM Customer_Fixed_Deposit
WHERE Customer_Fixed_Deposit.Cust_ID = Customer_Details.Cust_ID);
我们应该找到选择贷款的客户以及FD。
答案 0 :(得分:2)
两者的最终输出相同。