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] Postgresql invalid reference to FROM-clause entry for table error

Discussão em 'Outras Linguagens' iniciado por Stack, Agosto 31, 2021.

  1. Stack

    Stack Membro Participativo

    I want to run this query but PostgreSQL gives an "invalid reference to FROM-clause entry for table ua" error all the time.

    WITH Student as (
    SELECT COUNT(user_id) as Count,user_id
    FROM user_role
    WHERE deleted_flag = false
    GROUP BY user_id
    HAVING COUNT(user_id) = 1
    ORDER BY user_id
    )
    UPDATE user_account ua
    SET university_id = university_id || 'S'
    FROM Student s
    INNER JOIN user_role ur ON ua.user_id = ur.user_id AND ur.deleted_flag = false AND ur.role_id = 10;
    WHERE ua.user_id = s.user_id;


    Can anyone help me with this issue? Thank you!!!

    Continue reading...

Compartilhe esta Página