August 29, 2008 at 2:41 pm
This code generates my date with no problems:
select *
FROM
S_ADDR_PER a,ContactDataMaskTemp b, S_CONTACT c
where a.ROW_ID = c.PR_PER_ADDR_ID
and c.PER_TITLE_SUFFIX = b.CIFNUMBER collate Latin1_General_CI_AS
This code on the other hand gives me the following error: The multi-part identifier "c.PR_PER_ADDR_ID" could not be bound.
select *
FROM
S_ADDR_PER a
INNER JOIN ContactDataMaskTemp b
ON a.ROW_ID = c.PR_PER_ADDR_ID
INNER JOIN S_CONTACT c
ON c.PER_TITLE_SUFFIX = b.CIFNUMBER collate Latin1_General_CI_AS
I dont understand why as arent these two queries exactly the same?
I must be missing something obvious.
Any help?
August 29, 2008 at 2:57 pm
Nevermind. Im being a moron!:blush:
August 29, 2008 at 3:00 pm
Yeah you are missing something obvious. You are joining on c.PR_PER_ADDR_ID and I think you want b.PR_PER_ADDR_ID. Check out the bolded code, I also italicized the aliases in question:
select
*
FROM
S_ADDR_PER a INNER JOIN
ContactDataMaskTemp b ON
a.ROW_ID = c.PR_PER_ADDR_ID NNER JOIN
S_CONTACT c ON
c.PER_TITLE_SUFFIX = b.CIFNUMBER collate Latin1_General_CI_AS
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply