Solved

oracle function

Posted on 2015-02-09
1
259 Views
Last Modified: 2015-02-09
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
Comment
Question by:Sarma Vadlamani
1 Comment
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 40598214
select DeptNo, EName, row_number() over (partition by deptNo order by ename) rn
  from yourtable
order by DeptNo, EName
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
T-SQL Convert to PL/SQL 23 80
Oracle - Stored Procedure Privilge access 3 39
PL/SQL Search for multiple strings 5 40
Oracle Listener Not Starting 11 27
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Via a live example, show how to take different types of Oracle backups using RMAN.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now