Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NOTNULL在Mysql中的Case语句中不起作用_Mysql - Fatal编程技术网

NOTNULL在Mysql中的Case语句中不起作用

NOTNULL在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

我需要的是:

这是我的Api

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.