Solved

oracle function

Posted on 2015-02-09
1
262 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dataware house query tuning 9 81
How do I call MySQL Stored Procedure from oracle using HS link ? 5 43
clob to char in oracle 3 39
PL/SQL Two changes 7 27
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

770 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