1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] SQL Sequence query next value is last always last value + 10

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 14, 2021.

  1. Stack

    Stack Membro Participativo

    I created a SQL query that creates a new number that is always 10 higher than the last used value (for example company one has number 10 if a new company is added that company will get number 20).

    But I get an error and I don't know why it won't execute.

    My query is:

    CREATE SEQUENCE anr_num_gen
    START WITH anr = UPPER(anr)
    INCREMENT BY 10;


    But I get this error:


    bedrijf.public> CREATE sequence anr_num_gen
    start with anr = UPPER(anr)
    increment by 10

    [2021-09-13 22:51:28] [42601] ERROR: syntax error at or near "anr"
    [2021-09-13 22:51:28] Position: 50

    Can someone help me please?

    Continue reading...

Compartilhe esta Página