Query contains an illegal outer-join request

Posted on 1998-11-10
Last Modified: 2008-03-03
Let's say I have table 'a', 'b' and 'c'.

Here is my select statement:

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

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.
Question by:ivanh

Expert Comment

ID: 1091202
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.



Accepted Solution

kponder earned 100 total points
ID: 1091203
This will work if it is truely what you are trying to accomplish. Since you are using in both joins (where clause) changing it to a in the second is a valid operation.

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

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

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


Expert Comment

ID: 1091204
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.

Author Comment

ID: 1091205
The left join did the trick.  Thanks!

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now