Postgresql 类似oracle的decode oracle的decode大家都很熟悉,现在用postgresql的数据库好像没有类似的方法,在网上找了下有种写法也类似。
select (case when order_count = 0 then 1 else order_count end) as ordercount from order