MySQL之json格式字段

-- extra为json格式的扩展字段
-- 查询
select 
item_name as `名称`, 
item_code as `院内编码`,
extra -> '$.nationCode' as `国家医保码`,
extra -> '$.doseForm' as `剂型`, 
extra -> '$.origin' as `生产厂家`
from t_catalog as mhic
where mhic.catalog_type = 'FH0173.02' and mhic.is_deleted = 0 and not exists (select mmim.id from t_item_mapping mmim where mmim.is_deleted =0 and mmim.his_code = mhic.item_code);

-- 作为条件
select * from t_catalog where extra -> '$.licenseNo' = '国药准字Z20026439';
posted @ 2023-12-11 15:45  JaxYoun  阅读(20)  评论(0编辑  收藏  举报