Mysql 中的 case when 与HIVE 中 case when 的漏斗模式 区别

	'''
		 ,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    --  '企业身份标识号码'
	
	'''  
  • mysql 中的 case 是一个漏斗模型、当 A 条件符合、B 条件也符合的时候用就是用 B条件
    HVIE 中的 case 当满足 A 以后就不会对 B 进行判断

  • 这个是我小细节要注意 有的时候挺恶心人的 。。

猜你喜欢

转载自blog.csdn.net/a18302465887/article/details/83508805