NOTNULL在Mysql中的Case语句中不起作用
我需要的是: 这是我的ApiNOTNULL在Mysql中的Case语句中不起作用,mysql,Mysql,我需要的是: 这是我的Api metadata: {}, user_id: 142517, linkedinId: null, facebookId: "https:m", linkedinProfile: null, profile: null, edition: "current", social: "1" 我只是想知道如果 linkedinProfile为空 配置文件为空 国家不是空的 我的问题 (case when
metadata: {},
user_id: 142517,
linkedinId: null,
facebookId: "https:m",
linkedinProfile: null,
profile: null,
edition: "current",
social: "1"
- 我只是想知道如果
- linkedinProfile为空
- 配置文件为空
- 国家不是空的
(case
when (TRIM(user.linkedinProfile) <>'' or TRIM(user.profile)<>'') and user.country= '$country_code'
then 1
when
TRIM(user.linkedinProfile) <>'' or TRIM(user.profile)<>''
then 2
when user.country='$country_code'
then 3
else 4 end) social
- 请告诉我我的问题哪里错了
- 我有以下链接:
非null
尝试替换您的代码(这是正确的方法)。或者尝试ISNULL(user.linkedinProfile“”)
social in Api should 2, 3 else but not to be 1 as per my sql condition.