Mark Tabor

Mark Tabor

  • 933
  • 1.7k
  • 344k

How to get the count of a row

Apr 14 2022 11:45 PM

I have a one table in which i am storing customer and their installment amount , there are total 4 installment for each customer ,few customer missed few installment like customer ABC has installment 1 , but then he missed installment # 02 , then he get installment # 03 etc

Installment # Installment Amount Customer Name
1 100 ABC
2 100 ABC
3 100 ABC
4 100 ABC
1 100 XYS
3 100 XYS
4 100 XYS
1 100 GGG

As from above table you can see there are three customer , customer ABC get all installment ,customer XYS missed installment # 02 and Customer GGG get only one installment .
Now I want to get the count of all customer who get 

1-At least three installment 

2-in this query I want to get all those customers who get three consecutive installment like 1,2,3 

How to write these two queries in oracle , my table name is customer_installment


Answers (4)