changemax

sql:row_number() over(partition by xxxxxxxxxx order by yyyyyyyyyyyyy)

xxxxxxxxxx:分组字段;yyyyyyyyyyyyy:排序字段

select  
row_number() over(partition by d.area_code order by a.customer_name),  
a.customer_name, d.area_code 

from jc_customer as a
left join jc_province as b on a.province = b.province_name
left join jc_city as c on a.city = c.city_name and b.province_code = c.province_code
left join jc_area as d on a.area = d.area_name and c.city_code = d.city_code
order by d.area_code 

 

 

分类:

技术点:

相关文章:

  • 2021-08-15
  • 2021-06-17
  • 2021-04-06
  • 2021-08-07
  • 2021-11-09
  • 2021-06-25
  • 2021-08-18
猜你喜欢
  • 2021-11-12
  • 2021-11-09
  • 2021-12-09
  • 2022-01-01
  • 2021-11-04
  • 2022-01-01
  • 2021-10-15
相关资源
相似解决方案