此查询生成一个客户 ID 表:
SELECT Transactions.customerId
FROM Transactions
WHERE Transactions.purchaseDate <#9/1/2012#
GROUP BY Transactions.customerId
HAVING Sum(Transactions.amountPaid)<>0;
此查询生成事务表:
SELECT Customers.firstName, Customers.lastName, Transactions.transactionId, Transactions.product, Transactions.purchaseDate, Transactions.amountPaid, Customers.customerId
FROM Customers INNER JOIN Transactions ON Customers.customerId = Transactions.customerId
WHERE (((Transactions.refundTransaction)=False));
我想仅从第一个查询生成的用户中选择所有事务(第二个查询)。