2012-07-24 79 views

回答

2
SELECT s.*, case when score is null 
       then '--' 
       when score > 70 
       then 'pass' 
       else 'fail' 
      end as result 
from students s 
+0

如果分數列爲空,那麼我應該如何顯示「 - 」 – user1384356 2012-07-24 11:34:45

+0

請參閱我的更新的答案。 – 2012-07-24 11:36:42

+0

非常感謝你..它工作正常 – user1384356 2012-07-24 11:38:01