| Author |
Sql query
|
ankita balaji
Greenhorn
Joined: Aug 19, 2004
Posts: 11
|
|
Hai friends, Good Evening.Im new to SQL database and need a small help from you.Actually,I hav some questions posted in my database which are having 4 answers each.Now,can anyone please tell me the format of query of retreiving these multiple answers for the questions. Expecting help from you, Thanking you, Ankita
|
 |
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
|
|
According to the scenerio there should be two tables one for Questions and te other is for Answers. Tables ------ Question Answer there should be one to many relationship between Question and Answer. Assuming tables, Question -------- ID(pk) QUESTION ------ -------- ANSWER -------- ID(pk) QUES_ID(fk) ANSWER ------ -------- ------ query looks like this. ----------------- select ANSWER from ANSWER where QUES_ID = 'ANY' ------------------------- or use equi-join to join both tables [ October 05, 2004: Message edited by: adeel ansari ]
|
 |
 |
|
|
subject: Sql query
|
|
|