我正在尝试编写一个 SQL 查询来获取哪些客户定期支付账单而哪些没有。该表在 ORACLE 中。
CUSTOMERS table.
customers_id customers_name bill_value payment_date
----------------------------------------------------------
001 ary 30000 1/14/2012
001 ary 30000 2/14/2012
001 ary 30000 3/14/2012
001 ary 30000 4/14/2012
002 budhy 25000 1/21/2012
002 budhy 25000 2/25/2012
002 budhy 25000 3/21/2012
002 budhy 25000 4/23/2012
003 chanadh 51000 1/17/2012
003 chanadh 51000 2/17/2012
003 chanadh 51000 3/17/2012
003 chanadh 51000 4/17/2012
问题是..
首先,我想显示定期支付账单的客户,我期望的结果是这样的..
customers_id customers_name bill_value payment_date
----------------------------------------------------------
001 ary 30000 1/14/2012
001 ary 30000 2/14/2012
001 ary 30000 3/14/2012
001 ary 30000 4/14/2012
003 chanadh 51000 1/17/2012
003 chanadh 51000 2/17/2012
003 chanadh 51000 3/17/2012
003 chanadh 51000 4/17/2012
其次,我想展示没有定期支付账单的客户,我期望的结果是这样的..
customers_id customers_name bill_value payment_date
----------------------------------------------------------
002 budhy 25000 1/21/2012
002 budhy 25000 2/25/2012
002 budhy 25000 3/21/2012
002 budhy 25000 4/23/2012
现在我仍然坚持查询,我不知道该怎么做,有人可以帮忙吗?
对不起我的英语不好