2014-09-10 46 views

回答

1
select case when origin = 1 
      then 'read' 
      else 'not read' 
     end as origin 
from your_table 
+0

方便取+1 :) – 2014-09-10 09:16:34

+0

感謝您的輸入! – fritsimeel 2014-09-10 09:32:59

0

這可能是一個CASE expression

SELECT CASE origin 
     WHEN 1 THEN 'read' 
     WHEN 0 THEN 'not read' 
     ELSE  'whatever' -- optional 
     END 
FROM MyTable 
+0

你也謝謝! – fritsimeel 2014-09-10 09:33:40

相關問題