1. 程式人生 > >Mysql 中的 case when 與HIVE 中 case when 的漏斗模式 區別

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 進行判斷

  • 這個是我小細節要注意 有的時候挺噁心人的 。。