Subject | FB RC2 and Auto Join Query |
---|---|
Author | Luiz Alves |
Post date | 2002-01-08T00:32:45Z |
I have the next querys with FB RC2:
Q1:
select A.indice,A.nserv
from servico A
where A.ident_cp=13
Result:
Indice nserv
---------------
5 1
6 2
7 3
8 4
9 5
Q2:
select B.indice as Indice1,B.nserv as nserv1
from servico B
where B.ident_cp=395
Result:
Indice1 nserv1
---------------
1874 1
1875 2
1876 3
1877 4
Q3:
select A.indice,A.nserv,B.indice as Indice1,B.nserv as nserv1
from servico A
left outer join servico B on A.nserv=B.nserv
where A.ident_cp=13 and B.ident_cp=395
Result:
Indice nserv Indice1 nserv1
-----------------------------------
5 1 1874 1
6 2 1875 2
7 3 1876 3
8 4 1877 4
With this left join the correct result donĀ“t will be:
Result:
Indice nserv Indice1 nserv1
-----------------------------------
5 1 1874 1
6 2 1875 2
7 3 1876 3
8 4 1877 4
9 5 null null
Thanks,
Luiz.
Q1:
select A.indice,A.nserv
from servico A
where A.ident_cp=13
Result:
Indice nserv
---------------
5 1
6 2
7 3
8 4
9 5
Q2:
select B.indice as Indice1,B.nserv as nserv1
from servico B
where B.ident_cp=395
Result:
Indice1 nserv1
---------------
1874 1
1875 2
1876 3
1877 4
Q3:
select A.indice,A.nserv,B.indice as Indice1,B.nserv as nserv1
from servico A
left outer join servico B on A.nserv=B.nserv
where A.ident_cp=13 and B.ident_cp=395
Result:
Indice nserv Indice1 nserv1
-----------------------------------
5 1 1874 1
6 2 1875 2
7 3 1876 3
8 4 1877 4
With this left join the correct result donĀ“t will be:
Result:
Indice nserv Indice1 nserv1
-----------------------------------
5 1 1874 1
6 2 1875 2
7 3 1876 3
8 4 1877 4
9 5 null null
Thanks,
Luiz.