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
  • 52,746
  • 12
  • 114
  • 209
Learner_seeker
  • 544
  • 1
  • 4
  • 21

0 Answers0