本文介绍了从计数查询中执行选择查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我对SQL和Access非常陌生。我有一张付款表,一张发票表和两者之间的桥牌表。我正在尝试查看哪些发票使用多笔付款来支付这些费用。我能够使用计数查询来查找哪些客户端使用多个
付款,然后查询计数查询以查找哪些发票连接到哪个客户端,但我想在一个查询中完成所有操作。有什么建议?我有一些示例代码,但它基本上只是改变了Access SQL代码来尝试让它获得
工作,但我真的不知道我在做什么。感谢您提供任何帮助!  SELECT INVOICE.ID,PAYMENT.ID

来自付款内部联系(INVOICE INNER JOIN REDEMPTION INVOICE.ID = REDEMPTION.INVOICE_ID_NUMBER)PAYMENT.ID = REDEMPTION.PAYMENT_ID_NUMBER

WHERE((Count([PAYMENT]。[CLIENT_ID_NUMBER])> 1));


So I am very new to SQL and Access. I have a payments table, an invoice table, and a bridge table between the two. I am trying to see which invoices use multiple payments to pay for them. I was able to use a count query to find which clients use multiple payments, and then query the count query to find which invoices are connected to which client, but I want to do that all in one query. Any recommendations? I have some sample code, but its basically just changing around the Access SQL code to try and get it to work, but I really don't know what I am doing. Thanks for any help! SELECT INVOICE.ID, PAYMENT.ID
FROM PAYMENT INNER JOIN (INVOICE INNER JOIN REDEMPTION ON INVOICE.ID = REDEMPTION.INVOICE_ID_NUMBER) ON PAYMENT.ID = REDEMPTION.PAYMENT_ID_NUMBER
WHERE ((Count([PAYMENT].[CLIENT_ID_NUMBER])>1));

推荐答案


这篇关于从计数查询中执行选择查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 04:23