Competition: What’s your favorite Redgate tool? Enter now.

JOIN conditions

DAndres109@aol.com[email protected] Posts: 22 Bronze 2
edited June 27, 2008 9:00AM in SQL Prompt Previous Versions
Hi,

This one is tough for me to describe, so I'll just give an example:

Given:

Table A
Table B with foreign key to Table A
Table C with foreign key to Table A

When I write the following query:

SELECT *
FROM A
INNER JOIN B ON ...

The list of columns that appears is correct. However, when I write this:

SELECT *
FROM A
INNER JOIN B ON A.Something = B.Something
INNER JOIN C ON ...

The list of columns that appears should match C to A (using the foreign key), but it looks like SQLPrompt is trying to match C to B.

I get around this issue by always writing my JOINs to A immediately after the "FROM A" text.

Can this be fixed, or am I missing a setting somewhere?

Comments

  • Hi,

    Actually this is something that has bothered me as well and there is no setting in SQL prompt currently to address this. Although, we have been thinking about resolving this concern in our future versions and probably we will be able to get it sorted for v4.0.
    However, I'd rather restrain from a making any promises at this stage :)

    Thank you for taking the time to explain with such detailed examples.

    Regards,
    Tanya
    Project Manager
    Red Gate Software Ltd
Sign In or Register to comment.