Jump to content
Peaceandlove

Comparar Dados

Recommended Posts

Peaceandlove

Bom dia,

Sou novo neste fórum mas gostaria da vossa ajuda, estou a fazer um programa para a empresa em java, porém pediram me que fizesse um horário dos Professores e dos Alunos, mas que depois de inseridos tinha de comparar os dois e apenas retornar os campos que fossem iguais, estou a usar o inner join so que nao consigo fazer isso.

select *
from horarioc c
Inner join horariop z ON
c.s1 = z.s1 AND
c.s2 = z.s2 AND
c.s3 = z.s3 AND
c.s4 = z.s4 AND
c.s5 = z.s5 AND
c.s6 = z.s6 AND
c.s7 = z.s7 AND
c.s8 = z.s8 AND
c.s9 = z.s9 AND
c.s10 = z.s10 AND
c.s11 = z.s11 AND
c.s12 = z.s12 AND
c.t1 = z.t1 AND
c.t2 = z.t2 AND
c.t3 = z.t3 AND
c.t4 = z.t4 AND
c.t5 = z.t5 AND
c.t6 = z.t6 AND
c.t7 = z.t7 AND
c.t8 = z.t8 AND
c.t9 = z.t9 AND
c.t10 = z.t10 AND
c.t11 = z.t11 AND
c.t12 = z.t12 and
c.qa1 = z.qa1 and
c.qa2 = z.qa2 and
c.qa3 = z.qa3 and
c.qa4 = z.qa4 and
c.qa5 = z.qa5 AND
c.qa6 = z.qa6 AND
c.qa7 = z.qa7 AND
c.qa8 = z.qa8 AND
c.qa9 = z.qa9 AND
c.qa10 = z.qa10 AND
c.qa11 = z.qa11 AND
c.qa12 = z.qa12 and
c.qi1 = z.qi1 and
c.qi2 = z.qi2 and
c.qi3 = z.qi3 and
c.qi4 = z.qi4 and
c.qi5 = z.qi5 AND
c.qi6 = z.qi6 AND
c.qi7 = z.qi7 AND
c.qi8 = z.qi8 AND
c.qi9 = z.qi9 AND
c.qi10 = z.qi10 AND
c.qi11 = z.qi11 AND
c.qi12 = z.qi12 and
c.se1 = z.se1 and
c.se2 = z.se2 and
c.se3 = z.se3 and
c.se4 = z.se4 and
c.se5 = z.se5 AND
c.se6 = z.se6 AND
c.se7 = z.se7 AND
c.se8 = z.se8 AND
c.se9 = z.se9 AND
c.se10 = z.se10 AND
c.se11 = z.se11 AND
c.se12 = z.se12 and
c.sa1 = z.sa1 and
c.sa2 = z.sa2 and
c.sa3 = z.sa3 and
c.sa4 = z.sa4 and
c.sa5 = z.sa5 AND
c.sa6 = z.sa6 AND
c.sa7 = z.sa7 AND
c.sa8 = z.sa8 AND
c.sa9 = z.sa9 AND
c.sa10 = z.sa10 AND
c.sa11 = z.sa11 AND
c.sa12 = z.sa12 and
c.d1 = z.d1 and
c.d2 = z.d2 and
c.d3 = z.d3 and
c.d4 = z.d4 and
c.d5 = z.d5 AND
c.d6 = z.d6 AND
c.d7 = z.d7 AND
c.d8 = z.d8 AND
c.d9 = z.d9 AND
c.d10 = z.d10 AND
c.d11 = z.d11 AND
c.d12 = z.d12 and
c.cliente_idcliente = 1 and
z.professor_idprofessor = 1

O código cliente e professor são os que vão ser comparados, se me pudessem ajudar.

Obrigado.

Share this post


Link to post
Share on other sites
brunoais

Sem saber o código que foi usado para fazer as tabelas é muito mais difícil!


"[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31

Life is a genetically transmitted disease, induced by sex, with death rate of 100%.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.