2011-09-17 27 views

回答

48
select coalesce(max(column), 0) from mytable; 
+0

工作就像一個魅力!!!! –

7

嘗試:

SELECT coalesce(max(column), 0) myalias FROM mytable; 
1

做這兩種工作的?

  • select coalesce(max(foo),0) from bar 
    
  • coalesce((select max(foo) from bar),0)