The raw data queried:
It can be seen that the two columns marked in red have a lot of duplicate data, and the final effect we need is shown in the following figure:
For the specific implementation, let's go to SQL first:
1 with cte as( 2 select rid=row_number() over (partition by player_ID,a.player_name order by player_name),* from playinfo_demo1 a 3 ) 4 select 5 CASE when rid=1 then ltrim(player_ID) else '' END AS ID, 6 CASE when rid=1 then ltrim(player_name) else '' END AS name, 7 play_year,play_count FROM cte