Created
February 2, 2012 19:01
-
-
Save emersonsoares/1725120 to your computer and use it in GitHub Desktop.
E dai que eu não curto usar join
This file contains 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
select | |
a.codigo, a.nome as aluno, p.nome as responsavel, d.seqd, d.vencimento, d.valor, d.juros, | |
d.multa, d.outros, d.desconto, d.total, d.pagto, d.parcela, e.descricao as evento, | |
c.descricao as curso, cb.cod_bx as codigobaixa, u.nome, cb.cheque, cb.dinheiro, cb.cartdeb, | |
cb.cartcred, cb.permuta, cb.outros as outrosbx | |
from | |
alunos a, pessoas p, divialu d, eventos e, histalu h, cursos c, codbx cb, usuarios u | |
where p.codigo = a.cod_mae and | |
d.seqd = 38924 and | |
d.cod_alud = a.codigo and | |
e.codigo = d.evento and | |
h.cod_aluh = a.codigo and | |
c.nseq = h.nseqc and | |
c.ano = (select max(h2.ano) from histalu h2, alunos a2 where h2.cod_aluh = a.codigo) and | |
cb.cod_bx = d.codbx and | |
u.codigo = d.usu_inc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment