Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse Join type

Status
Not open for further replies.

Eldaria

Programmer
Sep 20, 2001
123
NL
To explain the topic more:
You know you can do different kind of Join types, for example: Select records from TableA and TableB where this field is the same. Or Select All records from TableA and only Records from TableA where This field is the same. Etc.
this is possible by using different Join Types.

But is it possible to make the opposite? So view all records from TableB that does not exist in TableB compare with this field.?? so where the Join types are not equal?

Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 

Select tableB.*
From tableB Left Join TableA
On tableB.key=tableA.key
Where tableA.key is null

Or

Select * From tableB
Where key Not In (Select key from TableA) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
tlbroadbent!, Thank you..

I tried this:
Now; both Queries are identical but have different criterias, to select specific data, but they have the same structure.

Select Query18.*
From Query18 Left Join Query19
On Query18.TemplateName=Query19.TemplateName
Where Query19.TemplateName is null;

It gives me an error message both when I try to go to design mode and when i try to view the query.
The error for design mode is that it can not view the join type, and it does not show the join type.

When I try to view the data i get an error message as following:
"The specified field 'Query18.TemplateName' could refer to more than one table listed in the from clause of your SQL statement."
And then it goes back to SQL view.

I did not know how to put the second option in to use.

Eldaria

That was my 25cent** of opinion.

** Inclusive Intrest, tax on interest, Genral tax, Enviromental tax, Tax, and tax on intrest, tax on fees, tax on tax, and other Various taxes and fees.
 

You must have Query18 listed more than once in the SQL statement. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top