Home > Database > Mysql Tutorial > body text

mysql-MySQL 如何设计并查询某个结果的值,不同情况下查到另一个表的不同信息

WBOY
Release: 2016-06-06 09:35:38
Original
1329 people have browsed it

mysql设计数据

具体问题描述如下:
例如现有以下数据:
数据1
mutid 用药信息
COSM1 a
COSM2 b
COSM3 c
COSM4 d

数据2
mutid 用药信息
COSM1+COSM2 e

逻辑是:如果这个人有 COSM1 COSM3 COSM4 三种变异那么得到的是
变异 用药信息
COSM1 a
COSM3 c
COSM4 d

如果这个人有COSM1 COSM2 COSM4 三种变异 那么得到的是

变异 用药信息
COSM1 + COSM2 e

COSM4 d

这样的表应该如何设计并且查询实现?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template