Created
January 11, 2019 18:12
-
-
Save matheusdavidson/717dd46d6d1761731b3ebb8fe11dc10f to your computer and use it in GitHub Desktop.
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
SET @pro_id := '0C5aec83c0dc47c'; | |
SELECT | |
p.balance SALDO, p.balance_pro SALDO_PROMOCAO, c.name Nome, c.email 'E-mail', c.cpf CPF, c.rg RG, c.birthday NASCIMENTO, c.phone TELEFONE, c.mobile CELULAR, c.cep CEP, c.number NUMERO, c.complemento COMPLEMENTO, c.bairro BAIRRO, c.city CIDADE, c.state UF, c.created_at CADASTRADO_EM | |
FROM | |
`esbox.api.sms`.pro_participants p | |
LEFT JOIN | |
`esbox.api.sms`.pro_clients c ON c.cli_id = p.cli_id | |
WHERE | |
p.pro_id = @pro_id AND | |
c.pro_id != @pro_id | |
ORDER BY | |
c.name DESC | |
LIMIT | |
99999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment