troubleshooting Question

how to increment the value in the table based on the query

Avatar of pardeshirahul
pardeshirahul asked on
Oracle Database
4 Comments1 Solution599 ViewsLast Modified:
INSERT INTO gecl.CCL_JE_LE_SEQUENCE (Ledger_id,
                                           period_name,
                                           DEFAULT_EFFECTIVE_DATE,
                                           JE_HEADER_ID,
                                           legal_Entity,
                                           CCL_JE_SEQUENCE)
SELECT l.ledger_id, h.period_name, default_effective_date, h.je_header_id, m.segment1, 1
  FROM apps.gl_code_combinations m, apps.gl_je_headers h, apps.gl_je_lines l --,
 --gl_je_categories n
 WHERE     h.je_header_id = l.je_header_id
       AND m.code_combination_id = l.code_combination_id
       AND l.ledger_id = 2947
       --AND h.je_category = n.je_category_name
       AND h.period_name = 'JAN-13'
       order by ledger_id, m.segment1, h.default_effective_date, h.je_header_id
       --AND h.je_category = 1

    /* Formatted on 9/11/2013 5:00:09 PM (QP5 v5.252.13127.32847) */
  SELECT ledger_id,
         period_name,
         default_effective_date,
         je_header_id,
         legal_entity,
         COUNT (*)
    FROM gecl.CCL_JE_LE_SEQUENCE
GROUP BY ledger_id,
         period_name,
         default_effective_date,
         je_header_id,
         legal_entity


in the below query i have done the group by
for each record in have to update the  CCL_JE_SEQUENCE column and it has to increment
like a sequence or a rownum
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros