Django increment Then value in Annotate Count -
let's have query set a.
a.annotate(c=count(case(when(name='jack',then=i)
now, each time a.name == 'jack'
, c
set i. how can increment each time happens? first case, i = 1
, 2nd i=2
etc.
let's have query set a.
a.annotate(c=count(case(when(name='jack',then=i)
now, each time a.name == 'jack'
, c
set i. how can increment each time happens? first case, i = 1
, 2nd i=2
etc.
Comments
Post a Comment