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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cartisian product queries? 1

Status
Not open for further replies.

MikeDNova

Programmer
Jul 3, 2002
86
US
hey guys,

i have two tables
tblCategoryResponse
priority - 7 entries
response - 7 entries

tblQuestion
CategoryID
QuestionID
Question
QuestionType


tblQuestionResponse
QuestionID
CategoryID
Response - Response
seqNo - Priority

i want to try to do a cartisian product query to append to the tblQuestionResponse table. I am trying to use the cartisian product to append the same response and priority entries from tblCategoryResponse, to tblQuestionResponse, for each question of QuestionType "Category."

I'm not sure how to even run this type of query in access.

any suggestions???

thanks in advance,
Mike
 
a cartesian product is simply an inner join without the join condition

Code:
insert 
  into tblQuestionResponse
     ( QuestionID
     , CategoryID
     , Response 
     , seqNo
     )
select Q.QuestionID
     , Q.CategoryID
     , C.response 
     , C.priority
  from tblQuestion Q
     , tblCategoryResponse C

to make sure this is what you want, run the select part of it by itself first

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top