The specific problem is described as follows: for example, the following data is available: data 1mutid medication information cosm1acsm2bcosm3ccosm4d data 2mutid medication information COSM1 + COSM2e logic is: if this person has three variations: COSM1COSM3COSM4, then the information about the variant medication is obtained. if this person has three variations: COSM1COSM2COSM4, how can the table such as COSM1 and COSM2eCOSM4d be designed and implemented. .. mysql design data
The specific problem is described as follows:
For example, the following data is available:
Data 1
Mutid medication information
COSM1
COSM2 B
COSM3 c
COSM4 d
Data 2
Mutid medication information
COSM1 + COSM2 e
The logic is: if this person has three variations: COSM1 COSM3 COSM4, what we get is
Variant medication information
COSM1
COSM3 c
COSM4 d
If this person has three variations: COSM1 COSM2 COSM4, what we get is:
Variant medication information
COSM1 + COSM2 e
COSM4 d
How should such a table be designed and queried?