0

Let's say I require a distinct count for each year with specific criteria as per where statement and x below being various years 2000 to 2016:

dbGetQuery(conn, "SELECT COUNT(DISTINCT ID)
                  FROM table x
                  WHERE cust_STATUS_DESC like '%matured%'
                  and YEAR(END_DATE) in ("x") ") )

How do I do this using a for loop or apply function?

zx8754
  • 46,390
  • 10
  • 104
  • 180
Learner_seeker
  • 494
  • 1
  • 4
  • 20

0 Answers0