时间:2021-07-01 10:21:17 帮助过:41人阅读
select
id,
@group_row:=CASE when @parent_code=a.staff_id then @group_row+1 else 1 end as groupRow,
@parent_code:=a.staff_id as parent_code
from ss_staff_ctrt a ,( select @group_row:=1, @parent_code:=‘‘) as b
ORDER BY a.staff_id
mysql 分组行号
标签:else from select mysq code _id case group sele