select krd.knr, krd.nam, krd.tlf, krd.liefnr, krd.zahlbed,
zlb.zahlbed, krd.liefbed, lfb.liefbed, zlb.sa, lfb.sa, zlb.bezeich1,
lfb.bezeich
from fyrkr1 krd, fyzlb zlb , fylfb lfb
where (krd.zahlbed=zlb.zahlbed)
and (krd.liefbed=lfb.liefbed)
and lfb.sa = 1
and zlb.sa = 1;
After the select statement above I get only 559 results.
I think the reason is that some records of the fields fyrkr1.zahlbed
and fyrkr1.liefbed have no entriess.
I tried
select krd.knr, krd.nam, krd.tlf, krd.liefnr, krd.zahlbed,
zlb.zahlbed, krd.liefbed, lfb.liefbed, zlb.sa, lfb.sa, zlb.bezeich1,
lfb.bezeich
from fyrkr1 krd left join fyzlb zlb left join fylfb lfb
where (krd.zahlbed=zlb.zahlbed)
and (krd.liefbed=lfb.liefbed)
and lfb.sa = 1
and zlb.sa = 1;
But I get an syntax errot message
What mus I do to get the whole list with the 1052 record?
Thanks
Ralf
Outer join?
select krd.knr, krd.nam, krd.tlf, krd.liefnr, krd.zahlbed,
zlb.zahlbed, krd.liefbed, lfb.liefbed, zlb.sa, lfb.sa, zlb.bezeich1,
lfb.bezeich
from fyrkr1 krd, outer fyzlb zlb, outer fylfb lfb
Perhaps?
--
Cheers,
Obnoxio The Clown
http://obotheclown.blogspot.com
--
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.
isql -v
IBM INFORMIX-SQL Version 7.32.UC4
Software Serial Number RDS#N000000
But I checked my syntax and saw that I forgot a comma "," before
"OUTER"
Now it runs
I thougt there is a comma-Join "," , a OUTER JOIN, INNER JOIN, RIGHT
JOIN, LEFT JOIN,
and if I use OUTER JOIN, INNER JOIN, RIGHT JOIN, LEFT JOIN, I dont
have to set ","
befor it.
I used this tutorial
http://www.sql-und-xml.de/sql-tutorial/tabellen-verknuepfen-mit-join.html
Hier is the right query that shows alle 1052 record
Thanks all
UNLOAD TO lieferantenstamm.csv DELIMITER ";"
SELECT krd.knr, krd.nam, krd.tlf, krd.liefnr, zlb.bezeich1,
lfb.bezeich
FROM fyrkr1 krd, OUTER fyzlb zlb, OUTER fylfb lfb
WHERE (krd.zahlbed=zlb.zahlbed)
AND (krd.liefbed=lfb.liefbed)
AND lfb.sa = 1
AND zlb.sa = 1;
Neither dbaccess 7.25 nor isql 7.32 support the ANSI '92 syntax for outer joins,
you have to use the older syntax that Informix has always supported for outer joins. That means that the INNER, LEFT, RIGHT, and FULL keywords are not recognized and OUTER requires a comma separator and is only left outer join.