背景: 首先,我有一个名为patients与我所关心的patient_id和alerts表架构(警报是一串字符,每个字符代表一些任意值/意思)。其次,每个“患者”都是一个组[family]的一部分,仅基于其patient_id的前6位数字。此外,还有一些第三方依赖这个数据库; 我没有设计也不能更改此模式/数据模型,我无法从MySQL迁移。 Here is a fiddle with the dat
这里是我的查询 SELECT con_serial,column2,column3
FROM
(SELECT con_serial,column2,column3
FROM big_table
WHERE ISNULL(contact1, '')+'#'+ISNULL(contact2, '')+'#'+ISNULL(contact3, '')+'#'+ISNULL(contact4, '