Update multiple rows of a column by same value in Oracle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sumanta5877
    New Member
    • Nov 2014
    • 1

    Update multiple rows of a column by same value in Oracle

    My expected out is

    ITEMNO ITEMPOS_NO

    1 1
    1 2
    1 3
    2 1
    2 2
    2 3
    3 1
    3 2
    3 3

    Any help would be appreciated. Thanks in Advance
  • nischalinn
    New Member
    • Mar 2014
    • 16

    #2
    Hello sumanta5877,
    can you please provide which field value you want to update?
    Please provide some details about your requirement and table structure.

    Thanks!

    Comment

    • Luuk
      Recognized Expert Top Contributor
      • Mar 2012
      • 1043

      #3
      Code:
      INSERT INTO TABLE mytable(ITEMNO) VALUES(1),(2),(3);
      INSERT INTO TABLE mytable SELECT T2.ITEMNO, T1.ITEMNO
                                FROM mytable T1, mytable T2;
      DELETE FROM mytable WHERE  ITEMPOS_NO is NULL;

      Comment

      Working...