我有一些表格:
"branch" table(branch_name, branch_city, assets)
"customer" table(customer_name, customer_street, customer_city)
"account" table (account_number, branch_name, balance)
"loan"table (loan_number, branch_name, amount)
"depositor"table (customer_name, account_number)
"borrower" table (customer_name, loan_number)
现在我想找到所有有帐户但没有贷款的客户 我试过
SELECT customer_name
FROM depositor
MINUS
SELECT customer_name
FROM borrower
但它显示错误1064
答案 0 :(得分:0)
我得到了答案
SELECT DISTINCT customer_name FROM depositor WHERE customer_name NOT IN(SELECT customer_name FROM borrower);