Icon View Incident Report

Serious Serious
Reported By: Jerry Martinez
Reported On: 4/23/1999
For: Version 1.13 Build 1
# 418 SQL Star (or Multi-Way) Joins Not Working in Some Queries

Try the 2 queries enclosed in the problem.zip file. Even though there is one record in each table, the query is returning 2 sets of duplicate records: one with the correct query result and another with blank data. I've done a work around with the first query by using the Distinct command in the query and
filtering out the blank records. With the second query, I wasn't so lucky with a workaround.

{ First Query }

SELECT D1.PersonId AS GroupId, D4.LocationDesc, D5.Number, D.PBNoteID
FROM "PBNOTE.DB" D, "USER.DB" D1, "PERSON.DB" D2, "LOCATION.DB" D3, 
"LOCADESC.DB" D4, "TELEPHON.DB" D5
WHERE
(D1.UserId = D.UserId)
 AND (D.PersonId =1)
 AND (D1.PersonId = 1)
 AND (D2.PersonId = D1.PersonId)
 AND (D3.LocationId = D1.LocationId)
 AND (D4.LocationDescId = D3.LocationDescId)
 AND (D5.TelephoneId = D3.TelephoneId)
Order By D4.LocationDesc

{ Second Query }

SELECT Distinct D.PBNoteID, D3.TelephoneId AS GroupId, D2.PersonDesc, 
D4.LocationDesc
FROM "PBNOTE.DB" D, "USER.DB" D1, "PERSON.DB" D2, "LOCATION.DB" D3, 
"LOCADESC.DB" D4, "TELEPHON.DB" D5
WHERE
(D1.UserId = D.UserId)
 AND (D.PersonId = 1)
 AND (D3.TelephoneId = 1)
 AND (D2.PersonId = D1.PersonId)
 AND (D3.LocationId = D1.LocationId)
 AND (D4.LocationDescId = D3.LocationDescId)
 AND (D5.TelephoneId = D3.TelephoneId)
ORDER BY D2.PersonDesc
 



Comments Comments
Problem was with the DBISAM SQL engine not being able to handle certain star, or multi-way joins properly.


Resolution Resolution
Fixed Problem on 5/5/1999 in version 1.14 build 1
Image