update table_a set business_type=( case
when target='EXHIBITS' then 'CONTENT'
when target='PROJECT' then 'CONTENT'
when target='LIVE_SPONSOR' then 'CONTENT'
when target='LIVE_EXHIBITOR' then 'CONTENT'
when target='MEETING_SPONSOR' then 'CONTENT'
when target='MEETING_EXHIBITOR' then 'CONTENT'
when target='NEWS' then 'CONTENT'
when target='EXHIBITOR' then 'EXHIBITION'
when target='EXHIBITOR_GROUP' then 'EXHIBITION'
when target='BUYER' then 'INVESTMENT'
when target='CERT' then 'TICKET'
when target='NUCLEIC_PROVE' then 'TICKET'
else NULL end);
解读:
使用case when then 更新表table_a , 根据target字段的值,更新business_type字段的值