Last active
August 7, 2017 08:26
-
-
Save hugopereira84/00d4bc3cbde1e168bf574f515ac6acbd to your computer and use it in GitHub Desktop.
Empresa ZAP - Zapweb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* to run workers */ | |
$ workers/resque worker:start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ir buscar a um user principal que pode ter varias contas servico */ | |
SELECT | |
count(1) as numNotasCredito, idconta, codigoconta | |
FROM | |
zapweb.notacredito inner join | |
zapweb.conta using (idconta) | |
group by idconta | |
having numNotasCredito > 19; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `utilizador` (`login`, `password`, `nome`, `datacriacao`, `estado`) | |
VALUES ('hpereira', md5('*****'), 'Hugo Pereira', '2016-01-18 14:39:45', 'A'); | |
INSERT INTO utilizador_perfil (idutilizador, idperfil) | |
SELECT | |
(SELECT idutilizador FROM utilizador WHERE login = 'hpereira') as idutilizador, | |
1 as idperfil; | |
INSERT INTO utilizador_loja ( | |
idutilizador, idloja, activa | |
) | |
SELECT | |
(SELECT idutilizador FROM utilizador WHERE login = 'hpereira') as idutilizador, | |
1 as idloja, | |
1 as activa; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment