Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

here's another join question

10 views
Skip to first unread message

mcnewsxp

unread,
Feb 25, 2013, 9:44:49 AM2/25/13
to
tableA
----------
recid searchkeyfield

tableB
------------
recid tableArecid reporttypeid reportdate

tableC
------------
recid searchkeyfield reporttypeid reportdate

so I want rows from tableB and TableC that contain the reporttype and reportdate
on their own row

how?

tia,
mcnewsxp

mcnewsxp

unread,
Feb 25, 2013, 10:36:58 AM2/25/13
to
SELECT a.LetterDate, LetterTypeLkup.LetterDescription
FROM CLetterHistory b INNER JOIN
LetterHistory a ON b.LetterID = a.RecID INNER JOIN
LetterTypeLkup ON a.LetterType = LetterTypeLkup.LetterTypeID
WHERE b.CID = @cid
UNION
SELECT LetterDate, LetterTypeLkup.LetterDescription
FROM LetterHistoryLog c INNER JOIN
LetterTypeLkup ON c.LetterTypeID = LetterTypeLkup.LetterTypeID
WHERE c.CID = @cid
0 new messages