0

Let's say I have query set A.

A.annotate(c=Count(Case(When(name='Jack',then=I)

Now, each time A.name == 'Jack', c will be set to I. How can I increment I for each time this happens? So that for the first case, I = 1, for the 2nd I=2 etc.

Mitchell van Zuylen
  • 3,905
  • 4
  • 27
  • 64

0 Answers0