add auto_increment to table add values

    0

    0

    Manuel Antunes

    The code inserts three new columns into the perspectives table, each representing a different entity: an entitye (E1 in this case), month of the year (9 in this case), and budgeted expenditure in Euros (1200 in this case). The generated by default column is then given the entity's id.

    ALTER TABLE perspectives ALTER COLUMN id
      ADD GENERATED BY DEFAULT AS IDENTITY
    
    
    insert into perspectives
    (entite,mois,budget,depense,compte,exercice)
    VALUES('E1','09',1200,300,'62351','2022'),
    ('E1','09',800,300,'64351','2022'),
    ('E1','09',999,455,'62351','2022'),
    ('E1','09',8976,300,'60711','2022')
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.