INSERT INTO versao_sistema (Dominio, Seq , Versao, DH_Atualizacao) SELECT 0, (SELECT (IFNULL(MAX(Seq), 0) + 1) FROM versao_sistema WHERE Dominio = 0 LIMIT 1),  "15.21.00", now() FROM dominio LIMIT 1;

INSERT INTO versao_sistema (Dominio, Seq , Versao, DH_Atualizacao) SELECT Dominio AS T_Dominio, (SELECT (IFNULL(MAX(Seq), 0)+1) FROM versao_sistema WHERE Dominio = T_Dominio LIMIT 1), "15.21.00",  now() FROM dominio WHERE Dominio > 0;

