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 |
|
subhaoviya
Posting Yak Master
135 Posts |
Posted - 2012-09-04 : 04:09:45
|
| Hi, I have 2 tablesT:customerT:customerQuestionsCustomerC1 C2Customer1 what is name?Customer1 what is age?Customer2 what is age?Customer3 what is name?Customer4 what is ageCustomer5 what is name?Customer5 what is age?I am expecting the result set like which set of question used frequently by customers. and that customer c1 value with corresponding question.thankssubha |
|
|
Mike Jackson
Starting Member
37 Posts |
Posted - 2012-09-04 : 08:27:04
|
| Not sure what your looking for, you seem to indicated you want to join the to tables. But you really only need the customerQuestions table unless you want to bring in other info from the customer table.select custid, question from customerQuestionsorder by custidhowever if you did join them it might look something like...select c.custid, cq.question from customer cjoin customerQuestions cqon c.custid=cq.custidorder by c.custid |
 |
|
|
|
|
|