Is there any way that I can query two tables at the same time without having a relationship between the two tables? There is absolutely no way to make a common field that is unique, but I'd like the report to show info from 2 tables at the same time.
Thanks!
Christa
Well you could but you would not get what you expect. A query without a relationship creates what's called a "cross-product". So for instance if you have the following 2 tables:
table1
Larry
Sue
John
table2
Apple
Orange
Pear
And you were to include them both in the same query without linking them:
select * from table1,table2
You would get something like:
Larry Apple
Larry Orange
Larry Pear
Sue Apple
Sue Orange
Sue Pear
John Apple
John Orange
John Pear
Mathematically a cross-product returns number of rows as:
table1 rows x table2 rows.
Back to the solution. You may want to create a report that has 2 embedded sub-reports in it, each based on one of your two tables.
On the other hand, you can generate SOMETHING which relates the records -or there is EVERY reason to NOT have both in the same query. One exception which MAY be of use (if at least the fields of interest are of the same number and types in the two tables is the UNION query. It is discussed to some degree in the ubiquitous {F1} arena and to a reasonable degree in all of the text re SQL / Relational data base.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.