salix/services/db/changes/1.0.1/03-createUserForClients.sql

5 lines
198 B
SQL

INSERT INTO account.user (id,name,role,password,active)
select c.Id_Cliente,c.Id_Cliente,2,'no_tiene',FALSE
FROM vn2008.Clientes c
LEFT JOIN account.user u ON u.id = c.id_cliente
where u.id is NULL