• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1126
  • Last Modified:

Query contains an illegal outer-join request

Let's say I have table 'a', 'b' and 'c'.

Here is my select statement:

select *
from   a, b, c
where  a.id *= b.id
and    b.id *= c.id

I know it's bad, but is there a way to do it w/o creating
any temporary tables?  I just want to be able to do it in one select statement.
1 Solution
Do you mean without MS SQL Server, behind the scenes creating a temporary table? Probably not... but your definitely right... it's a bad thing to do.

Maybe you could tell us what you want in a little more detail. Such as your real table names.


This will work if it is truely what you are trying to accomplish. Since you are using b.id in both joins (where clause) changing it to a in the second is a valid operation.

select *
from   a, b, c
where  a.id *= b.id
and    a.id *= c.id

If you did not intend for b.id to be used in both clauses the following example will work

select * from a
  left join b on a.id = b.id
  left join c on b.X = c.id      'substitute x with field name

If what you want is to have all the rows this should work

select * from   a
select * from  b
select * from c

Union is a powerful operator when you request the same information from different tables. You could create a view to hold this information. Let me know if this is what you needed.
ivanhAuthor Commented:
The left join did the trick.  Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now