所以我们有各种各样的产品,包括水果和非过期的东西,如纸张。产品---------到期我如何才能显示案例陈述:产品不是苹果或产品不是橙色的情况下填写到期1?
答案 0 :(得分:0)
为什么不使用Union而不是case语句..(表结构和列结构未知,但您可以使用下面的概念。
select productname, expiratieonDate as Expiration
from <table>
where productType = fruits
UNION
select productname, 1 as Expiration
from <table>
where productType = nonexpiration