[firebase-br] Mais um "Montar SQL"
Cleber Nandi
cleber.nandi em gmail.com
Sáb Dez 15 19:06:24 -03 2012
Não sei muita coisa, mas pode tentar assim que deve funcionar.
> Date: Sat, 15 Dec 2012 18:41:31 -0200
> From: rnribeiro em gmail.com
> To: lista em firebase.com.br
> Subject: Re: [firebase-br] Mais um "Montar SQL"
>
> Um select com inner join resolve teu problema
> Em 15/12/2012 17:07, "Zottis" <bzottis em ig.com.br> escreveu:
>
> > Pessoal, as vezes coisas simples parecem Fugir da nossa mente. To me
> > batendo
> > de novo para montar uma pesquisa
> >
> >
> >
> > Agradeço desde já qualquer ajuda...
> >
> >
> >
> > O Quadro é o seguinte:
> >
> >
> >
> > Tenho uma tabela “Apresentacoes”
> >
> > Com a estrutura:
> >
> > CREATE TABLE APRESENTACOES (
> >
> > CODIGO PK NOT NULL,
> >
> > DATA_CAD DATAS,
> >
> > CAMINHO_ARQUIVO VARCHAR_120,
> >
> > ARQUIVO ARQUIVOS
> >
> > );
> >
> >
> >
> > Tenho um tabela de eventos
> >
> > CREATE TABLE EVENTOS (
> >
> > COD_EVENTO PK NOT NULL,
> >
> > DATA_CAD DATAS,
> >
> > EVENTO VARCHAR_35
> >
> > );
> >
> >
> >
> > E mais uma tabela associativa juntando as duas:
> >
> > CREATE TABLE EVENTOS_APRESENTACOES (
> >
> > CODIGO PK NOT NULL,
> >
> > COD_EVENTO PK,
> >
> > COD_APRESENTACAO PK
> >
> > );
> >
> >
> >
> > preciso que ao digitar o nome de um evento me retorne as apresentações que
> > estejam cadastradas na tabela associativa
> >
> > Tentei assim mas não da certo:
> >
> >
> >
> > select a.codigo, a.data_cad, a.caminho_arquivo, a.arquivo
> >
> > from APRESENTACOES a
> >
> > where (select e.evento from eventos e where e.cod_evento in
> >
> > (select ea.cod_evento from eventos_apresentacoes ea
> >
> > where ea.cod_apresentacao = a.codigo))= :Evento
> >
> >
> >
> > and a.caminho_arquivo containing :Busca
> >
> >
> >
> >
> >
> > ______________________________________________
> > FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> > Para saber como gerenciar/excluir seu cadastro na lista, use:
> > http://www.firebase.com.br/fb/artigo.php?id=1107
> > Para consultar mensagens antigas: http://firebase.com.br/pesquisa
> >
> ______________________________________________
> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> Para saber como gerenciar/excluir seu cadastro na lista, use: http://www.firebase.com.br/fb/artigo.php?id=1107
> Para consultar mensagens antigas: http://firebase.com.br/pesquisa
Mais detalhes sobre a lista de discussão lista