• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

oracle function

i have a requirement of getting autonumbering like for ex.as below. it should start from one when the dept number changes. thanks.

Dept NO. Ename
10             1.test
10             2.test
10             3.test
20             1.test
20              2.test
20              3.test
0
Sarma Vadlamani
Asked:
Sarma Vadlamani
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
select DeptNo, EName, row_number() over (partition by deptNo order by ename) rn
  from yourtable
order by DeptNo, EName
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now