怎么查询多值代码中的某一个(ArteryBase)
2016-12-05 本文已影响0人
奇哥威武
使用函数 regexp_split_to_table()
实例 aj 中的 ajsj 是多值代码 查询 为8的
SELECT t_ajsj.c_bh from
(
SELECT c_bh,regexp_split_to_table(c_ajsj,';') as ajcj from t_aj where c_ajsj is not null) t_ajsj where t_ajsj.ajcj = '8'
会把里面的多值代码拆成子表