Guest_imported
New member
- Jan 1, 1970
- 0
I want one query to select the matching records, on Branch and Account Number, from one table in two other tables. I need to do a Union, but it does not appear that Paradox supports this. Here is what I have:
SELECT DISTINCT D1.BranchNbr, D1.AccountNbr
FROM "BTXREF.DB" D, "INVENTRY.DB" D1
WHERE
(D1.BranchNbr = D.BranchNbr)
AND (D1.AccountNbr = D.AccountNbr)
ORDER BY D1.BranchNbr, D1.AccountNbr
UNION
SELECT DISTINCT D1.BranchNbr, D1.AccountNbr
FROM "BTXREF.DB" D, "TRANSIT.DB" D1
WHERE
(D1.BranchNbr = D.BranchNbr)
AND (D1.AccountNbr = D.AccountNbr)
ORDER BY D1.BranchNbr, D1.AccountNbr
SELECT DISTINCT D1.BranchNbr, D1.AccountNbr
FROM "BTXREF.DB" D, "INVENTRY.DB" D1
WHERE
(D1.BranchNbr = D.BranchNbr)
AND (D1.AccountNbr = D.AccountNbr)
ORDER BY D1.BranchNbr, D1.AccountNbr
UNION
SELECT DISTINCT D1.BranchNbr, D1.AccountNbr
FROM "BTXREF.DB" D, "TRANSIT.DB" D1
WHERE
(D1.BranchNbr = D.BranchNbr)
AND (D1.AccountNbr = D.AccountNbr)
ORDER BY D1.BranchNbr, D1.AccountNbr