Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8501135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:07:30+00:00 2026-06-11T01:07:30+00:00

SOURCE_TABLE ———— OID EVENT_ID 1 1111 2 2222 3 1111 4 1111 5 1111

  • 0
SOURCE_TABLE 
------------
OID EVENT_ID  
1   1111  
2   2222
3   1111  
4   1111  
5   1111  
6   2222  
7   2222  
8   2222  

FINAL_TABLE  
------------
SNO EVENT_ID    OID LINE_NUMBER  
1   1111        1   1  
2   1111        1   2  
3   1111        3   3   
4   1111        3   4  
5   1111        4   5  
6   1111        4   6  
7   1111        5   7  
8   1111        5   8  
9   2222        2   1  
10  2222        2   2  
11  2222        6   3  
12  2222        6   4  
13  2222        7   5  
14  2222        7   6  
15  2222        8   7  
16  2222        8   8

I am using Oracle 11g. I want to insert data from SOURCE table to the FINAL table. In the FINAL table Line Number need be unique for each EVENT_ID (eg. 1111).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:07:32+00:00Added an answer on June 11, 2026 at 1:07 am

    Suppose SNO is a auto increment PK in the Final_Table. Use ROW_NUMBER() function:

    insert into FINAL_TABLE   (EVENT_ID,  OID,  LINE_NUMBER)
      (
        select EVENT_ID,OID,
           ROW_NUMBER() OVER(PARTITION BY EVENT_ID ORDER BY OID) as LINE_NUMBER
        from source_table
      );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using a populated Table Type as the source for a TSQL-Merge. I want to
I am using in insert statement to convert BDE table (source) to a Firebird
I'm using SQL Server 2008 R2. I have a source table of data (I_Vendor)
I want to convert a table storing in Name-Value pair data to relational form
I want transfer some data between 2 tables from difference DBs But the source
When using SSIS to load data from a source table, we have a OLE
I have two separate table, I want to merge into a single table using
I want to Change Column data type from 'VarChar' to 'DataType' While inserting into
My intention is to insert data from source table into target table. Source table
I want to export data from one table into a new one with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.