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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 using a view instead of 3 recordsets.

Author  Topic 

jazzym
Yak Posting Veteran

94 Posts

Posted - 2001-10-20 : 21:20:31
I have created my own poll scripts and tables. On my results page i show a graph of the results.

The question is stored in one table.

The choices in another, referencing the ID of the question in the questions table.

A results table with results referencing to the ID of the choice in the choices table..

On my results page i want to show the question and the results for each choice. So i need to grab info from all three tables.

I could open up three recordsets to get this but i wondered if a view could grab them all in one recordset?

I have tried to create a view to do this but the results seem to be wrong.

i need to get the "question" field from the questions table, the "choices" field from the choices table (usualy has around 5 records for each question) and do a count of the results per choice.

Any help greatly apreciated as always. Hope i haven't made this seem more confusing than it already is.

Cheers.
   

- Advertisement -