'''
,CASE WHEN social_credit_code IS NOT NULL THEN '10-统一社会信用代码'
WHEN organization_structure_code IS NOT NULL THEN '20-组织机构代码'
WHEN business_license IS NOT NULL THEN '30-工商注册号'
END AS enterprise_main_identification_type -- '企业主要身份识别类型'
,CASE WHEN social_credit_code IS NOT NULL THEN social_credit_code
WHEN organization_structure_code IS NOT NULL THEN organization_structure_code
WHEN business_license IS NOT NULL THEN business_license
END AS corporate_identity_number -- '企业身份标识号码'
'''
-
The case in mysql is a funnel model. When the A condition is met and the B condition is also met, the case in the B condition is used.
When A is met, B will not be judged. -
This is a small detail that I have to pay attention to. Sometimes it is quite disgusting. .