2014-08-29 77 views
-3

因此,我們有多種產品,包括水果和紙張等非過期材料。產品---------過期如何做案例陳述來顯示:產品不是蘋果或產品不是橙色的情況,然後填寫到期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

回答

0

爲什麼不使用聯盟,而不是一個case語句。(表結構和列結構不知道,但你可以用下面的概念。

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