SQL Question

Results 1 to 2 of 2

Thread: SQL Question

  1. #1
    Join Date
    Dec 1969

    Default SQL Question

    Hello,<BR>I have a table called Test that contains :<BR>1. userid<BR>2. testid<BR><BR>I have another table called response that contains :<BR><BR>1. testid<BR>2. question<BR>3. answer<BR>4. number<BR><BR>I created a table called History which is set up like this:<BR><BR>1. testid<BR>2. question<BR>3. answer<BR>4. number<BR>5. userid<BR><BR>Its is a compination of the 2 tables. How do I create an Insert stayment that grabs the userid and testid from Test and grabs question, answer, number from response and inserts userid,testid,question,answer and response into history?<BR><BR>I have been killing myself over this one? <BR>thanks for th ehelp in advance.

  2. #2
    peterjl@austec.net.au Guest

    Default RE: SQL Question

    insert into History(userid,testid,question,answer) select distinct test.userid, test.testid, response.question, response.answer from test, response where test.testid = response.testid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts