我创建了这个sql select查询:
SELECT subscription_new_projects.banners, subscription_new_projects.banner_link
FROM subscription_new_projects
WHERE be_famous_id =32
AND now( ) < end_date
ORDER BY subscription_new_projects_id DESC
获取此sql结果:
现在我想将banners
字段设为空,如果banner_link
不为空。
我想要这个结果:
我的SQL小提琴:Example
任何想法如何做到这一点?
感谢。
答案 0 :(得分:2)
您可以使用 @Override
protected void onActivityResult(int requestCode, int responseCode,
Intent intent) {
example.onActivityResult(requestCode, responseCode, intent);
}
case-when
答案 1 :(得分:0)
使用CASE
声明。
<强>查询强>
SELECT
CASE WHEN subscription_new_projects.banner_link != ''
THEN NULL
ELSE subscription_new_projects.banners
END AS banners,
subscription_new_projects.banner_link
FROM subscription_new_projects
WHERE be_famous_id =32
AND now( ) < end_date
ORDER BY subscription_new_projects_id DESC;