多变量的案例陈述

问题描述:

因此,我们有多种产品,包括水果和纸张等非过期材料。产品---------过期如何做案例陈述来显示:产品不是苹果或产品不是橙色的情况,然后填写到期1?多变量的案例陈述

+3

请向我们提供一些示例数据和表结构,预期的结果集,以及到目前为止已经增长的查询,以便其他人可以提供帮助。 – 2014-08-29 18:45:31

+0

case this when this = true或(that is null and this = false)then 1 else'I am a香蕉'结束 – Twelfth 2014-08-29 19:21:40

为什么不使用联盟,而不是一个case语句。(表结构和列结构不知道,但你可以用下面的概念。

select productname, expiratieonDate as Expiration 
    from <table> 
where productType = fruits 
UNION 
select productname, 1 as Expiration 
    from <table> 
where productType = nonexpiration