Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
superhero
Yak Posting Veteran
52 Posts |
Posted - 2008-03-07 : 06:40:47
|
Hi everyoneI'm stuck on this Friday afternoon with something I though would be quite easy when I started with it this morning:I have to create a product configurator for my company - we ask a user 20 questions and based on his answers we then suggest which products will do the job.Each of the 20 questions have multiple answers like 'yes', 'no', 'not sure', 'doesn't matter' etc. So I have a table 'CONFIGQUESTIONS' AND A 'CONFIGANSWERS' table. CONFIGQUESTIONS HAS THESE FIELDS:[CQID] AUTONUMBER ID[QUESTION]CONFIGANSWERS HAS THESE FIELDS:[CAID] AUTONUMBER ID[CQID][ANSWER]THEN I created a table called PRODUCTMATCHES. This table has these fields:[MATCHID] AUTONUMBER ID[CQID][CAID][PRODUCTID]Because product A can have several different answers for Question 1, I need to have something similar to this in the PRODUCTMATCHES table:CQID CAID PRODUCTID1 1 11 2 12 4 22 5 2As you can see a product might have the ability to scan in black and white and in colout with product ID 1. So if the question was "Do you need to scan in colour or black and white" product 1 should match if the user selected colour or Black and white. I have 20 questions with various number of answers for each question and each product might have more than one relevant answer per question.I have a page with the 20 questions and next to each question a combobox with the relevant answers for that question.After the user selected the answers from the dropdownlists next to each question (only one answer per question is allowed) I want to query PRODUCTMATCHES JOINED WITH PRODUCTS ON PRODUCTID to see which products match all the answers provided.Any ideas? |
|
|
|
|