Hi,
We have a table as below with 3 columns V_NUMBER,D_CREATED and N_PGM
EC599980| 10/12/2015 12:00:00 AM | PGM1
EC599980| 10/09/2015 12:00:00 AM | PGM2
EC492925| 10/26/2015 12:00:00 AM | PGM1
EC503933| 11/15/2015 12:00:00 AM | PGM1
EC503933| 11/12/2015 12:00:00 AM | PGM1
EC503933| 11/11/2015 12:00:00 AM | PGM1
We have added a new column I_SEQ with NOT NULL DEFAULT, so the values in the new column are ZEROs
EC599980 | 10/12/2015 12:00:00 AM | PGM1 | 0
EC599980 | 10/09/2015 12:00:00 AM | PGM2 | 0
EC492925 | 10/26/2015 12:00:00 AM | PGM1 | 0
EC503933 | 11/15/2015 12:00:00 AM | PGM1 | 0
EC503933 | 11/12/2015 12:00:00 AM | PGM1 | 0
EC503933 | 11/11/2015 12:00:00 AM | PGM1 | 0
now we need to update the I_SEQ with the Sequence Number for all the duplicate records (V_NUMBER) as below the latest record
EC599980 | 10/09/2015 12:00:00 AM | PGM1 | 1
EC599980 | 10/12/2015 12:00:00 AM | PGM2 | 2
EC492925 | 10/26/2015 12:00:00 AM | PGM1 | 1
EC503933 | 11/11/2015 12:00:00 AM | PGM1 | 1
EC503933 | 11/12/2015 12:00:00 AM | PGM1 | 2
EC503933 | 11/15/2015 12:00:00 AM | PGM1 | 3
can someone help to write the update query
Sequence Number update for the duplicate records
Moderators: Kalicharan, Moderator Group
-
- Member
- Posts: 13
- Joined: Mon Feb 17, 2014 11:35 am
- Location: Hyderabad
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page