Subject | To JOIN or not to JOIN that is the question |
---|---|
Author | Bhavbhuti Nathwani |
Post date | 2009-06-15T06:06:45Z |
Hi all
I would like to bring in data from a table that does not have a corresponding FK in another table What I have currently done (see below) is to join with this another table and do a <> comparision. Is this fine or there is a more efficient way to do this.
Thanks and regards.
Bhavbhuti
SELECT CAST(tBOMIssue.iID AS CHAR(12)) AS ctBMRID,
tBOMIssue.CBK AS cBMRBk,
... more fields
FROM tBOMIssue tBOMIssue
one join here...
JOIN tWastedChit
ON tBOMIssue.iID <> tWastedChit.itBMRID
ORDER BY tBMRDt, cBMRBk, iBMRNo
I would like to bring in data from a table that does not have a corresponding FK in another table What I have currently done (see below) is to join with this another table and do a <> comparision. Is this fine or there is a more efficient way to do this.
Thanks and regards.
Bhavbhuti
SELECT CAST(tBOMIssue.iID AS CHAR(12)) AS ctBMRID,
tBOMIssue.CBK AS cBMRBk,
... more fields
FROM tBOMIssue tBOMIssue
one join here...
JOIN tWastedChit
ON tBOMIssue.iID <> tWastedChit.itBMRID
ORDER BY tBMRDt, cBMRBk, iBMRNo