Correleted Sub Query with joins and aliases

K

kmccoskey

Jason,

I modified your stuff to look like this and I think it does do what I want.
SELECT TEST_1.ID,
TEST_1.NAME,
TEST_2.ID,
TEST_2.NAME
FROM TEST_2
RIGHT JOIN (TEST_1 LEFT JOIN TEST_DATA_1_2 ON TEST_1.ID =
TEST_DATA_1_2.ID1) ON TEST_2.ID = TEST_DATA_1_2.ID2 ORDER BY TEST_1.ID;

I also tried
SELECT A.ID, A.NAME, C.ID1, C.ID2, B.ID, B.NAME
FROM (TEST_1 AS A LEFT JOIN TEST_DATA_1_2 AS C ON A.ID=C.ID1) LEFT JOIN
TEST_2 AS B ON C.ID2=B.ID
ORDER BY A.ID;

and it gave the same results as yours did. I would like to do it with
subqueries though.


Thank you Jason,


Kirk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top