Comparing Columns from Different Tables

Comparing Columns from Different Tables

I have a problem comparing columns from different tables. I tried:

 SELECT tblThumBereinigt.Nummer, dbo_BABEWERTUNG.BANUMMERFROM dbo_BABEWERTUNG, tblThumBereinigtWHERE (((dbo_BABEWERTUNG.BANUMMER)[tblThumBereinigt].[Nummer]));

but this does not give me what I want. How can I compare different tables with an exclusive condition?

Try this:

 select * from information_schema.columns

That should give you a list of information about the columns in your database.

As a matter of form, though, doing the not-equals comparison here matches every row from the left-hand table to every row of the right-hand table, because each instance of number will NOT EQUAL any other, so you’ll wind up with a giant cross-join instead.


Share the Post: