Updated SQL help

Hi all

I need correct column value serNo to the right as a result. It suppose to be the sequence number for each storeID. Any suggestion on the SQL?

create table test1 (storeID number (5), number serNo (5));

insert into table test1 values (100, 1);

insert into table test1 values (200, 1);

insert into table test1 values (100, 1);

insert into table test1 values (200, 1);

insert into table test1 values (100, 1);

insert into table test1 values (100, 1);

I want to have the following results in test1 after conversion:

1 100

2 100

3 100

4 100

1 200

2 200

Thank you

Hello

942572 wrote:

Hi all

I need correct column value serNo to the right as a result. It suppose to be the sequence number for each storeID. Any suggestion on the SQL?

create table test1 (storeID number (5), number serNo (5));

insert into table test1 values (100, 1);

insert into table test1 values (200, 1);

insert into table test1 values (100, 1);

insert into table test1 values (200, 1);

insert into table test1 values (100, 1);

insert into table test1 values (100, 1);

I want to have the following results in test1 after conversion:

1 100

2 100

3 100

4 100

1 200

2 200

Thank you

Use the ROW_NUMBER analytic function to generate the new sernos, like this:

MERGE INTO dst test1

WITH THE HELP OF)

SELECT ROWID AS r_id

ROW_NUMBER () OVER (PARTITION BY storeid

ORDER BY NULL

) AS serno

OF test1

)               src

ON (summer time. ROWID = src.r_id)

WHEN MATCHED THEN UPDATE

SET dst.serno = src.serno

;

Really, your table must have a primary key.  Because it's not working, I had to ROWID allows you to uniquely identify the lines.

Tags: Database

Similar Questions

  • Bulletins of update error: ' error: failure of the verification of signatures for: message XML Update SQL.

    Hi all

    I get this error when when looking for Windows newsletters (Patching-> Windows-> news-> news-> control upgrade). Looking at the Task Manager, I see "error: failure of the verification of signatures for: message XML Update SQL.

    I use the latest version vCM 5.8.2. I found another post here on this subject, which mentioned that the KB 2050220 fixed the problem, but it does not work for me .

    You have any other ideas I could try? Where would the real logs that could help me understand what the problem?

    Thank you.

    Well, what it fixed.  Looked in the debugging information, and indeed it was related to the KB 2050220:

    Level: error

    Time: 17/04/2016 10:53:43:460

    ClassName: clsPatchVerification

    FuncName: VerifyPatch

    MSG: (0) downloaded the file: C:\Program Files (x86)\VMware\VCM\Sum\Collector\SUM2_postxml.sql.cab has not a signature of trust manager of Configuration of VMware. Certificate IssuedTo: The issuer of the certificate VMware, Inc.: SHA2 DigiCert assured ID Code signing CA

    SourceDesc: UI

    RequestId: default

    JobId:

    JobMachineName:

    The problem with the added SQL KB is it is old... is no longer reflecting the reality, as the certificate of the cabin has now SHA2 DigiCert assured ID Code Signing CA, and not DigiCert assured ID Code Signing CA - 1 as written in the query SQL attached to the KB.

    That's why we:

    Original VMware KB:

    SET QUOTED_IDENTIFIER ON

    SET ANSI_NULLS

    IF NOT EXISTS

    (

    SELECT *.

    OF dbo.ecm_sysdat_certificate_configuration_settings_ui

    WHERE configuration_name = "DigiCert assured ID Code Signing CA - 1"

    )

    BEGIN

    INSERT INTO dbo.ecm_sysdat_certificate_configuration_settings_ui

    (

    configuration_name,

    configuration_description,

    is_subject,

    is_issuer,

    is_configuration_allowed,

    last_modified_by_id,

    last_modified_datetime

    )

    VALUES

    (

    "DigiCert assured ID Code Signing CA - 1",

    NULL,

    0,

    1,

    1,

    NULL,

    NULL VALUE

    )

    END

    GO

    FIX:

    SET QUOTED_IDENTIFIER ON

    SET ANSI_NULLS

    IF NOT EXISTS

    (

    SELECT *.

    OF dbo.ecm_sysdat_certificate_configuration_settings_ui

    WHERE configuration_name = "SHA2 DigiCert assured ID Code Signing CA"

    )

    BEGIN

    INSERT INTO dbo.ecm_sysdat_certificate_configuration_settings_ui

    (

    configuration_name,

    configuration_description,

    is_subject,

    is_issuer,

    is_configuration_allowed,

    last_modified_by_id,

    last_modified_datetime

    )

    VALUES

    (

    "DigiCert assured SHA2 Code ID signing CA",

    NULL,

    0,

    1,

    1,

    NULL,

    NULL VALUE

    )

    END

    GO

  • Cannot display the results to the database during "Update": SQL statement

    Hello

    I get this error trying to update a VO via the UI or BCBrowser.

    Cannot display the results to the database during "Update": SQL statement

    This is a default single front & right THAT VO creates on the object of the entity (Database Table)

    On the same table and with the same credentials of DB, I could update the record.

    Any guess on what went wrong?

    Thanks in advance for any help.

    p.s Jdev 11.1.1.6

    Journal:

    oracle.jbo.DMLException: Houston-26041: could not publish data from database in "Update": SQL statement "START the CAR UPDATED CarEO SET SEL_ITEM =: 1 WHERE TXN_NO =: 2 AND LOGID =: AND SEQNO = 3: 4 POLL DELIVERY_MODE, CERTIFICATION_REQ, SOFT_COPY_IND, SELITEM IN: 5,: 6,: 7,: 8; END; ».

    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:583)

    at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8575)

    at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6816)

    at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3290)

    at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3093)

    at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2097)

    at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2378)

    at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1615)

    at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1417)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1437)

    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2150)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)

    at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)

    at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)

    at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:111)

    to oracle.jbo.uicli.controls.JUNavigationBar$ NavButton.actionPerformed (JUNavigationBar.java:118)

    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

    in javax.swing.AbstractButton$ Handler.actionPerformed (AbstractButton.java:2318)

    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)

    at java.awt.Component.processMouseEvent(Component.java:6289)

    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)

    at java.awt.Component.processEvent(Component.java:6054)

    at java.awt.Container.processEvent(Container.java:2041)

    at java.awt.Component.dispatchEventImpl(Component.java:4652)

    at java.awt.Container.dispatchEventImpl(Container.java:2099)

    at java.awt.Component.dispatchEvent(Component.java:4482)

    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)

    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)

    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)

    at java.awt.Container.dispatchEventImpl(Container.java:2085)

    at java.awt.Window.dispatchEventImpl(Window.java:2478)

    at java.awt.Component.dispatchEvent(Component.java:4482)

    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)

    to java.awt.EventQueue.access$ 000 (EventQueue.java:85)

    in java.awt.EventQueue$ 1.run(EventQueue.java:603)

    in java.awt.EventQueue$ 1.run(EventQueue.java:601)

    at java.security.AccessController.doPrivileged (Native Method)

    in java.security.AccessControlContext$ 1.doIntersectionPrivilege(AccessControlContext.java:87)

    in java.security.AccessControlContext$ 1.doIntersectionPrivilege(AccessControlContext.java:98)

    in java.awt.EventQueue$ 2.run(EventQueue.java:617)

    in java.awt.EventQueue$ 2.run(EventQueue.java:615)

    at java.security.AccessController.doPrivileged (Native Method)

    in java.security.AccessControlContext$ 1.doIntersectionPrivilege(AccessControlContext.java:87)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Caused by: java.sql.SQLException: invalid column type

    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:150)

    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:399)

    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:581)

    at oracle.jdbc.driver.OracleCallableStatementWrapper.registerOutParameter(OracleCallableStatementWrapper.java:1765)

    at oracle.jbo.server.OracleSQLBuilderImpl.bindUpdateStatement(OracleSQLBuilderImpl.java:2243)

    at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:10524)

    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:412)

    ... 52 more

    The problem is solved now.

    new columns added to the database table, after the creation of the entity object. Those changes were not picked up in the entity object.

    I found this difference after object entity with the DB Table comparison.

    And when I added these new columns to EO & VO, I don't get this error more.

    Thanks to all who tried to help

  • Report of update SQL query with line selector. Update process.

    I have a report of update SQL query with the selectors in line.
    How to identify line selector in a process update on the page.

    I want to update some columns with a value of an area of selection on the page.

    With the help of the base:

    UPDATE table_name
    SET Column1 = value
    WHERE some_column = some_value

    I would need to do:

    UPDATE table_name
    SET column1 =: P1_select
    WHERE [line selector] =?

    Now sure how to identify [line selector] and/or validate it is checked.
    Thank you
    Bob

    Identify the name of the checkbox of the source of the page element, it should be of the fxx format (f01, f02... f50).
    Suppose that we f01.

    for i in 1 .. apex_application.g_f01.count
    loop
      UPDATE CONTRACTS
      SET SIP_LOAD_FLAG = :P16_STATUS
      where  =  apex_application.g_f01(i); --i'th checked record' primary key
    end loop;
    
  • I own a Macbook pro mid 2012. Now I want to increase the RAM of 4 GB to 8 GB, please suggest if this update will help me to improve my performance to macbook.

    I own a Macbook pro mid 2012. Now I want to increase the RAM of 4 GB to 8 GB, please suggest if this update will help me to improve my performance to macbook.

    It will help in cases where the applications require more than 4 GB of RAM.  Otherwise, there will be no noticeable difference.  If you really want to increase the speed, an SSD is the best option.  They cost about 3 x's + more than a traditional HDD of same capacity...

    Ciao.

  • Have now uninstalled 43 updates, the computer was not install them for at least a month. Also error code 0 x 643 on an update Please HELP...

    This problem is driving me crazy, go round in circles, trying to use microsoft update to help. No help for the moment... Error 0x8009310B code is on the rest the updates failed.

    mentioned, check if it helps.

    When you try to install an update for .NET Framework 1.0, 1.1, 2.0, 3.0 or 3.5, you may receive Windows Update '0 x 643' error code or error code Windows install "1603".

    http://support.Microsoft.com/kb/923100 MissCats Hi,

    1. Do you have the latest changes on the computer?
    2. You have security software installed on the computer?

    Method 1

    I suggest that reset you the default Windows Update components and later try to install updates.

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058

    Also check out the article below and try the steps

    Method 2

    If the previous step fails, then I suggest you temporary disable the security software installed on the computer and install 5 updates at a time, to check if it helps.

    Important: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you do not disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network during the time that your antivirus software is disabled, your computer is vulnerable to attacks.

  • I want to update my photoshop CC 2015? I can't find a Cloud of update application, if I try to update in help > updates nothing happens. What should I do?

    I want to update my photoshop CC 2015? I can't find a Cloud of update application, if I try to update in help > updates nothing happens. What should I do?

    Try direct updates

    CC updates to 2015:

    http://prodesigntools.com/Adobe-CC-2015-updates-links-Windows.html

    http://prodesigntools.com/Adobe-CC-2015-updates-links-Mac.html

  • I do not see one of my apps, I see everything on my desktop except the apps app! He said: download error, I need the new Prime Minister because I started to edit in my school where everything is updated. Help! I even tried to download from Adob

    I do not see one of my apps, I see everything on my desktop except the apps app! He said: download error, I need the new Prime Minister because I started to edit in my school where everything is updated. Help! I even tried to download from Adobe on the web but it brought him back to the top of the desktop application...

    Please visit: CC help | Download error in the applications tab of Creative Cloud Desktop Application

  • After you have reinstalled my old CS6 Design Standard on a new Mac Pro I can't use the updates in help. I only receive offers on update creative Cloud applications. I don't have any application of CC. How to find updates for my applications CS6?

    After you have reinstalled my old CS6 Design Standard on a new Mac Pro I can't use the updates in help. I only receive offers on update creative Cloud applications. I don't have any application of CC. How to find updates for my applications CS6?

    Beginning of the updates here and product selection, read to see if you need to install updates in the order of the numbers, or if updates are cumulative for the product http://www.adobe.com/downloads/updates/

  • Using 'Redirect to Page' and ' Action to update SQL ' together

    When I finished to modify data in the fields on page 3, I want to commit my changes and redirect to page 6.

    On page 3, under the heading ' Action when the button clicked ", if I select"Submit Page"and" Action to UPDATE SQL ', my changes are committed to the database, but I am not redirected to page 6 (which, of course, makes perfect sense).

    If I select "redirect to Page in this application" and "action SQL UPDATE", comes the redirection to page 6, but my changes are not committed to the database.

    What I am doing wrong?

    Using the version online at apex.oracle.com.

    Mark T. says:
    When I finished to modify data in the fields on page 3, I want to commit my changes and redirect to page 6.

    On page 3, under the heading ' Action when the button clicked ", if I select"Submit Page"and" Action to UPDATE SQL ', my changes are committed to the database, but I am not redirected to page 6 (which, of course, makes perfect sense).

    If I select "redirect to Page in this application" and "action SQL UPDATE", comes the redirection to page 6, but my changes are not committed to the database.

    What I am doing wrong?

    You must submit the page, then branch of the page 6.

    (You can review pages similar to the sample application or another application to see how things are handled it.)

  • Update SQL Command - help

    Hi all

    Can anyone help me please with the sql command.

    Here is the example of the table:-
     
    Table:-     EMP     
    *EMP_ID     ACCOUNT_NUMBER     ACOCUNT_NAME*
    102     1658751S10     JOHN MILTON
    103     18425335S3     ROSE MILTON
    104     184344751S2     CHRISTOPHER MARK
    125     20808778S2     SUE
    145     224532472S1     ABDUL HALIM AHMAD
    165     45216698      RABAB ABDUL
    166     5896542              SURAYA AKTER
    168     145879              TUHIN AHAMED
    169     4578956              FREDERICK ADCOCK
    170     4213588             ANDREW HILTON
    105     805878997S3     WILLIAM ALLAN
    108     98714739S2     KENNETH JOHN ANSTEY
    109     1377658043S21     JILLIAN MINEAR BOURNE
    111     19942551S12     ELIZABETH MARGARET BLOXHAM 
    Please note that there is % of the letter ' to some account numbers.
    I would like to remove % ' account number and the place, the account name.
    After updating the result would be as below:
    EMP_ID     ACCOUNT_NUMBER     ACOCUNT_NAME
    102     1658751             JOHN MILTON (S10)
    103     18425335     ROSE MILTON (S3)
    104     184344751     CHRISTOPHER MARK (S2)
    125     20808778     SUE (S2)
    165     45216698     RABAB ABDUL
    166     5896542             SURAYA AKTER
    Please advice how would be to this day.

    Concerning
    Joy

    I think that u inserted bad records in the table emp1.

    Data also well account_number and account_name are interchanged. I think so

    check your data

    S

  • TABLE OF UPDATE SQL BASED ON THE VALUE OF THE TABLE HELP

    Here is an example of a table that I have and I need basically help make and update statement. My syntax is all messed up. I have update the 'INDY' column WHEN THE NUM AND NUM 2 and INDY are the same. In other words it since it needs to update the last N with a 'Y '.
    TABLE NAME TEST_1
    
    NUM  NUM2     INDI
    1       A           Y
    1       A           Y
    1       A            N
    I hope this feeling...

    Here's what I have so far but it dosent seem to work... someone can point me in the right direction.



    UPDATE T_TEST
        SET INDI = 'Y'
        WHERE NUM IN (SELECT COUNT(NUM) FROM T_TEST WHERE INDI = 'Y' 
         GROUP BY NUM
        HAVING COUNT(NUM) > 1);
    UPDATE T_TEST T1
      SET INDI = CASE (SELECT COUNT(*) FROM T_TEST T2 WHERE T2.NUM = T1.NUM AND T2.NUM2 = T1.NUM2)
                   WHEN 1 THEN 'N'
                   ELSE 'Y'
                 END
    /
    
    3 rows updated.
    
    SQL> SELECT  *
      2    FROM  T_TEST
      3  /
    
           NUM N I
    ---------- - -
             1 A Y
             1 A Y
             1 A Y
    
    SQL> 
    

    SY.

  • Update sql need help for hierarchy table

    I'm trying to update the raw field based on each unit Qty is the appearance of the table.

    slevel | Manager | seller | unit_qty | gross Qty


    0 | Mary | Mary | 1. 1


    .1 | Mary | Lynn | 3. null


    .1 | Mary | Betty | 2. null


    .1 | Mary | Alice | 2. null


    .. 2. Alice | Susan | 1. null


    .1 | Mary | Amy | 4. null


    I'd like the table to look like this after the update, with the values

    slevel | Manager | seller | unit_qty | gross Qty


    0 | Mary | Mary | 1. 1


    .1 | Mary | Lynn | 3. 3 * 1 = {color: #ff0000} 3 {color}


    .1 | Mary | Betty | 2. 2 * 1 = {color: #ff0000} 2 {color}


    .1 | Mary | Alice | 2. {color: #008000} 2 * 1 {color} = {color: #ff0000} 2 {color}


    .. 2. Alice | Susan | {color: #0000ff} 1 {color} | {color: #008000} 2 * 1 {color} {color: #0000ff} * 1 {color} = {color: #ff0000} 2 {color}


    .1 | Mary | Amy | 4. 4 * 1 = {color: #ff0000} 4
    {color}
    It is the SQL, I've tried to use unsuccessfully.


    Update table set gross_qty = unit_qty * ({color: #ff0000} select gross_qty from table {color})


    ({color: #ff0000} where Manager = seller {color})


    where slevel & gt; 0

    This is not the same thing?

    UPDATE vendor s1
    SET s1.gross_qty =
    (CASE
    WHEN s1.slevel = 0 THEN s1.unit_qty
    WHEN s1.slevel > 0 THEN
    S1.unit_qty * (SELECT SELLER s2 WHERE s2.client = s1.manager s2.gross_qty)
    (END);

    I wrote here a basis of hierarchical queries:

    http://blog.mclaughlinsoftware.com/hierarchical-queries-basics/

    It could be that useful...

  • Update SQL script

    Hi friends,

    I started this thread yesterday, but for some reason that I'm not able to answer/continue on this old thread. Here are the details from the old thread

    I need help with a sql script to update sid_no_new column with values based on sid_no for about 6000 + records.

    Here is an example below...

    SQL > select * from test1;

    SID_NO SID_NO_NEW UNIT_NO

    --------------------         --------------------           --------------------

    2000                                                          unit1

    2000                                                          unit3

    2000                                                          unit4

    2002                                                          unit16

    4500                                                          unit22

    In the example above, there are 3 sid_no consecutive '2000'. Sid_no_new must be 2000_1, 2000_2, 2000_3, respectively.

    It should be like:

    SQL > select * from test1;

    SID_NO SID_NO_NEW UNIT_NO

    --------------------      --------------------           --------------------

    2000 2000_1 unit1

    2000 2000_2 unit3

    unit4 2000_3 2000

    2002 2002 unit16

    4500 4500 unit22

    I ran the script (thanks to the experts who have contributed to) below, it works very well for the above documents, but I get ORA-30926 error when I run on the table with 6000 records...

    Fusion IN test1 tgt USING

    (SELECT sid_no,

    sid_no_new,

    unit_no,

    Count (sid_no) over (partition BY sid_no) cnt,

    ROW_NUMBER() over (partition BY order of sid_no to unit_no) rn

    OF test1

    ) CBC ON(tgt.sid_no=src.sid_no AND tgt.unit_no=src.unit_no)

    WHEN matched THEN

    UPDATE SET Sid_no_new = CASE WHEN cnt > 1 THEN sid_no |' _'. RN ELSE sid_no END;

    ERROR on line 1:

    ORA-30926: failed to get a stable set of rows in the source tables

    Please give your suggestions... Thank you very much

    In fact, this could be done easier:

    SQL > select *.

    test1 2

    3.

    SID_ SID_NO UNIT_N

    ---- ------ ------

    2000 2000_1 unit1

    2000 2000_2 unit3

    unit4 2000_3 2000

    2002 2002 unit16

    4500 4500 unit22

    SQL > select *.

    2 of test4

    3.

    UID_NO TYP RULE_DUE

    ---------- --- ----------

    RAF 2000 90

    3140 TH 100

    6712 JUL 21

    233 12 H6

    SQL > fusion

    2 in d of test4

    3 use)

    4 with as t4)

    5. Select uid_no,

    6                               type,

    7                               rule_due,

    8 rowid RID,

      9                               uid_no || '_' || ROW_NUMBER() over (partition by uid_no by 1 order) sid_no_new

    10 of test4

    11                      )

    12. Select t1.sid_no_new,

    T4.type 13,

    T4.rule_due 14,

    15 cases

    16 when t1.sid_no = t1.sid_no_new then t4.rid

    17 when t4.sid_no_new = t1.sid_no_new then t4.rid

    18 end rid

    19 of t4,

    Test1 20 t1

    21 where t1.sid_no = t4.uid_no

    22          ) s

    23 on)

    24 d.rowid = s.rid

    25       )

    26 when matched

    27 then

    Update 28

    29 set d.uid_no = s.sid_no_new

    30 when no match

    31 then

    32 insert

    33 values)

    s.sid_no_new 34,

    s.type 35,

    36 s.rule_due

    37                )

    38.

    3 lines merged.

    SQL > select *.

    2 of test4

    3.

    UID_NO TYP RULE_DUE

    ---------- --- ----------

    2000_1 RAF 90

    3140 TH 100

    6712 JUL 21

    233 12 H6

    2000_3 RAF 90

    2000_2 RAF 90

    6 selected lines.

    SQL >

    SY.

  • PL/SQL help

    I'm pretty new in pl/sql, I want to update a column with the next number.

    Here's an example-

    Table: political

    Policy_noSequenceCompany_name
    1010ABC PTY LTD.
    1010XYZ PTY LTD
    1030Test PTY LTD
    1040Test101 PTY LTD
    1010Pearl PTY LTD
    1040MyZore pty ltd

    I would get the date in the following format

    After Update - table

    Policy_noSequenceCompany_name
    1011ABC PTY LTD.
    1012XYZ PTY LTD
    1013Pearl PTY LTD
    1031Test PTY LTD
    1041Test101 PTY LTD
    1042MyZore pty ltd

    Basically, I want to update the column sequence based on the Policy_No group.

    Can someone please help.

    >

    Basically, I want to update the column sequence based on the Policy_No group.

    >

    This query will show you how to generate the values you need.

    >

    Select empno, deptno, row_number() over (partition by deptno) myRow arrested by deptno from EMP

    EMPNO, DEPTNO, MYROW

    7782,10,1

    7839,10,2

    7934,10,3

    7566,20,1

    7902,20,2

    7876,20,3

    7369,20,4

    7788,20,5

    7521,30,1

    7844,30,2

    7499,30,3

    7900,30,4

    7698,30,5

    7654,30,6

    >

    According to the number of rows in the table, you might be better to create a new table using DEC or a query like this.

Maybe you are looking for