[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bump::msaccess

Title:MSACCESS
Moderator:BUMP::HONER
Created:Tue Dec 01 1992
Last Modified:Mon Jun 02 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1661
Total number of notes:6339

409.0. "problem with constructing a query" by CLARID::HOFSTEE (Digital has it now! You'll get it later) Wed Nov 03 1993 12:46

T.RTitleUserPersonal
Name
DateLines
409.1BUSY::SLABAnd one of us is left to carry on.Tue Feb 25 1997 16:4927
    
    	A "problem" realted to the title of the base note but not the
    	content:
    
    	I somehow ended up with a query that had 4 tables, and output
    	fields from all 4 tables, but no indicated relationships between
    	the tables [IE, there was no joining of fields specified].  So I
    	ran it, and it went on and on for a long time before I finally
    	stopped it.
    
    	What was Access trying to do?  I figured it'd give me the output
    	from all 4 tables in succession with no matching records from
    	the other tables:
    
    	Field Field Field Field Field Field Field Field
            1     1
            1     1
                        1     1
                        1     1
                                    1     1
                                    1     1
                                                1     1
                                                1     1

    
	So, what WAS it trying to do?
    
409.2Cartesian productOSEC::pervy.mco.dec.com::gilbertbcyberpaddlerTue Feb 25 1997 18:0220
Apparently this will produce a 'Cartesian product', which Help defines as:


"Cartesian product

The result of joining two relational tables, producing all possible ordered 
combinations of rows from the first table with all rows from the second 
table. 
Generally, a cartesian product results from executing a SQL SELECT statement 
referencing two or more tables in the FROM clause and not including a WHERE 
or JOIN clause that indicates how the tables are to be joined."

That means that if the four tables have N1, N2, N3 and N4 records in them 
respectively, the output will be a recordset with N1 * N2 * N3 * N4 records.

This is standard relational database behaviour.

Brian.

409.3BUSY::SLABAntisocialTue Feb 25 1997 18:097
    
    	Thanks.  I tried looking through the Access V2 book but couldn't
    	find anything and didn't know how to look it up.
    
    	And A*B*C*D would have been quite large, since A and B alone are
    	23K records each.