Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
i have the following table

diseasename:A symptomlist:a1,a2,a3
diseasename:B symptomlist:b2,a1,c2
diseasename:B symptomlist:b3,a1,c2,a3 

Then i want to retrieve disease name for dynamic input of symptom list
when they retrieve the disease it counts the disease eg. if the the input of symptom list are :a1,b2,c2
the out put is:
count=1        diseasename=A
count=3        diseasename=B
count=1        diseasename=C

"please help"
sql query ,normalizing the table, any code or any useful information is ok.

THANK U FOR U'R ADVICE
Posted
Updated 23-Feb-10 23:26pm
v5

1 solution

Please buy a good book to learn about databases. It will help you in Designing databases, writing queries, etc.

For the query you posted, here is one of the start that you can take:

MstDisease
Column1 Column2
1 Disease-A
2 Disease-B
3 Disease-C

MstSymptom

Column1 Column2
1 a1
2 a2
3 b1
4 b2
5 c1
6 c2

TrnDiseaseSymptom
Column1 Column2
(MstDisease ID) (MstSymptom ID)
1 1
1 4
2 2
2 4
2 6
3 1
3 3
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900